From 72dd36efcfeb4c38cc0977762e50327d59af105d Mon Sep 17 00:00:00 2001 From: MickLesk <47820557+MickLesk@users.noreply.github.com> Date: Mon, 12 Oct 2026 15:02:41 +0200 Subject: [PATCH 1/2] Draw a Community Scripts banner while a script has no header of its own A new script has no generated header until the workflow has run, and every header_info variant then cleared the screen and drew nothing. The placeholder is embedded, so it costs no fetch and cannot 404 itself. --- core/core.func | 18 ++++++++++++++++++ incus/build.func | 7 ++++++- incus/tools.func | 3 ++- incus/vm-core.func | 14 ++++++++------ pve/vm-core.func | 3 +++ 5 files changed, 37 insertions(+), 8 deletions(-) diff --git a/core/core.func b/core/core.func index 2afa60a..1d4250d 100644 --- a/core/core.func +++ b/core/core.func @@ -1401,6 +1401,21 @@ exit_script() { # - Determines app type (ct/vm) from APP_TYPE variable # - Returns header content or empty string on failure # ------------------------------------------------------------------------------ +# Drawn until the generator has produced a script's own banner (figlet +# slant, two lines so it fits 80 columns); the app name follows in plain text. +_CS_FALLBACK_HEADER=' ______ _ __ + / ____/___ ____ ___ ____ ___ __ ______ (_) /___ __ + / / / __ \/ __ `__ \/ __ `__ \/ / / / __ \/ / __/ / / / +/ /___/ /_/ / / / / / / / / / / / /_/ / / / / / /_/ /_/ / +\____/\____/_/ /_/ /_/_/ /_/ /_/\__,_/_/ /_/_/\__/\__, / + /____/ + _____ _ __ + / ___/__________(_)___ / /______ + \__ \/ ___/ ___/ / __ \/ __/ ___/ + ___/ / /__/ / / / /_/ / /_(__ ) +/____/\___/_/ /_/ .___/\__/____/ + /_/' + get_header() { # Slug must match what the generator writes: APP lowercased, spaces removed. local app_name=$(echo "${APP,,}" | tr -d ' ') @@ -1483,6 +1498,9 @@ header_info() { if [ -n "$header_content" ]; then echo "$header_content" + else + echo "${_CS_FALLBACK_HEADER:-Community Scripts}" + echo " ${APP:-}" fi } diff --git a/incus/build.func b/incus/build.func index 327293e..c8fa33d 100644 --- a/incus/build.func +++ b/incus/build.func @@ -553,7 +553,12 @@ header_info() { header_content=$(get_header "$app_name" 2>/dev/null || true) fi clear 2>/dev/null || true - [[ -n "$header_content" ]] && echo "$header_content" + if [[ -n "$header_content" ]]; then + echo "$header_content" + else + echo "${_CS_FALLBACK_HEADER:-Community Scripts}" + echo " ${APP:-}" + fi return 0 } diff --git a/incus/tools.func b/incus/tools.func index fb29241..e521407 100644 --- a/incus/tools.func +++ b/incus/tools.func @@ -317,7 +317,8 @@ header_info() { if [[ -n "$header_content" ]]; then echo "$header_content" else - echo -e "${INCUS_HEADER:-Incus :: ${APP:-Container}}" + echo "${_CS_FALLBACK_HEADER:-Community Scripts}" + echo " ${APP:-}" fi } diff --git a/incus/vm-core.func b/incus/vm-core.func index 1e4633d..b247edf 100644 --- a/incus/vm-core.func +++ b/incus/vm-core.func @@ -65,18 +65,20 @@ load_incus_vm_functions() { load_functions() { load_incus_vm_functions; } header_info() { - # get_header derives the slug from APP and APP_TYPE itself. Same contract as - # the Proxmox path: no banner means draw nothing. The text fallback this used - # to print ("Incus VM :: Home Assistant OS") read like the banner had been - # replaced on purpose, so a header that simply failed to fetch looked like a - # deliberate design rather than the missing artwork it is. + # get_header derives the slug from APP and APP_TYPE itself; without a banner + # the shared placeholder from core.func is drawn, same as on Proxmox. local header_content="" APP_TYPE="${APP_TYPE:-vm}" if declare -f get_header >/dev/null 2>&1; then header_content=$(get_header 2>/dev/null || true) fi _cs_clear - [[ -n "$header_content" ]] && echo "$header_content" + if [[ -n "$header_content" ]]; then + echo "$header_content" + else + echo "${_CS_FALLBACK_HEADER:-Community Scripts}" + echo " ${APP:-}" + fi return 0 } diff --git a/pve/vm-core.func b/pve/vm-core.func index 2eb95b8..b9aab0b 100644 --- a/pve/vm-core.func +++ b/pve/vm-core.func @@ -201,6 +201,9 @@ header_info() { if [ -n "$header_content" ]; then echo "$header_content" + else + echo "${_CS_FALLBACK_HEADER:-Community Scripts}" + echo " ${APP:-}" fi } From 941aff7dcc9465f3583a03e4727b23392d35d4fc Mon Sep 17 00:00:00 2001 From: MickLesk <47820557+MickLesk@users.noreply.github.com> Date: Mon, 12 Oct 2026 15:59:13 +0200 Subject: [PATCH 2/2] Keep the placeholder banner on one line like the generated headers --- core/core.func | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/core/core.func b/core/core.func index 1d4250d..ae98de0 100644 --- a/core/core.func +++ b/core/core.func @@ -1401,20 +1401,14 @@ exit_script() { # - Determines app type (ct/vm) from APP_TYPE variable # - Returns header content or empty string on failure # ------------------------------------------------------------------------------ -# Drawn until the generator has produced a script's own banner (figlet -# slant, two lines so it fits 80 columns); the app name follows in plain text. -_CS_FALLBACK_HEADER=' ______ _ __ - / ____/___ ____ ___ ____ ___ __ ______ (_) /___ __ - / / / __ \/ __ `__ \/ __ `__ \/ / / / __ \/ / __/ / / / -/ /___/ /_/ / / / / / / / / / / / /_/ / / / / / /_/ /_/ / -\____/\____/_/ /_/ /_/_/ /_/ /_/\__,_/_/ /_/_/\__/\__, / - /____/ - _____ _ __ - / ___/__________(_)___ / /______ - \__ \/ ___/ ___/ / __ \/ __/ ___/ - ___/ / /__/ / / / /_/ / /_(__ ) -/____/\___/_/ /_/ .___/\__/____/ - /_/' +# Drawn until the generator has produced a script's own banner (figlet slant, +# like the generated ones); the app name follows in plain text. +_CS_FALLBACK_HEADER=' ______ _ __ _____ _ __ + / ____/___ ____ ___ ____ ___ __ ______ (_) /___ __ / ___/__________(_)___ / /______ + / / / __ \/ __ `__ \/ __ `__ \/ / / / __ \/ / __/ / / / \__ \/ ___/ ___/ / __ \/ __/ ___/ +/ /___/ /_/ / / / / / / / / / / / /_/ / / / / / /_/ /_/ / ___/ / /__/ / / / /_/ / /_(__ ) +\____/\____/_/ /_/ /_/_/ /_/ /_/\__,_/_/ /_/_/\__/\__, / /____/\___/_/ /_/ .___/\__/____/ + /____/ /_/' get_header() { # Slug must match what the generator writes: APP lowercased, spaces removed.