From f7240cd096f475ee89b09558be04acacda4680d0 Mon Sep 17 00:00:00 2001 From: librelad Date: Fri, 22 May 2026 11:50:45 +0100 Subject: [PATCH] style(cli): box section headers and the logo in double-line borders MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Swap the ### hash headers (isHeader) for a ╔═╗ ║ ╚═╝ double-line box and wrap the LibrePortal logo in a matching 52-wide box. Build the rule with printf-repeat and fixed pad widths instead of tr/${#} so multibyte box chars stay aligned regardless of locale. Mirrors the credentials panel. Applied to all three copies (markers.sh, init.sh, generate_arrays.sh). Co-Authored-By: Claude Opus 4.7 Signed-off-by: librelad --- init.sh | 25 ++++++++++++------------- scripts/menu/message/markers.sh | 16 ++++++++-------- scripts/source/files/generate_arrays.sh | 25 ++++++++++++------------- start.sh | 11 ++++++----- 4 files changed, 38 insertions(+), 39 deletions(-) diff --git a/init.sh b/init.sh index d55cc6b..bddd305 100755 --- a/init.sh +++ b/init.sh @@ -30,11 +30,12 @@ isNotice() { echo -e "${YELLOW}NOTICE:${NC} $1"; } isQuestion() { echo -e -n "${BLUE}QUESTION:${NC} $1 "; } displayLibrePortalLogo() { - echo " - ╦ ┬┌┐ ┬─┐┌─┐ ╭─╮ ╔═╗┌─┐┬─┐┌┬┐┌─┐┬ - ║ │├┴┐├┬┘├┤ │◉│ ╠═╝│ │├┬┘ │ ├─┤│ - ╩═╝┴└─┘┴└─└─┘ ╨─╨ ╩ └─┘┴└─ ┴ ┴ ┴┴─┘" - echo "" + local hbar; hbar=$(printf '═%.0s' $(seq 1 50)) + printf '\n╔%s╗\n' "$hbar" + printf '║%6s%s%8s║\n' '' '╦ ┬┌┐ ┬─┐┌─┐ ╭─╮ ╔═╗┌─┐┬─┐┌┬┐┌─┐┬' '' + printf '║%6s%s%8s║\n' '' '║ │├┴┐├┬┘├┤ │◉│ ╠═╝│ │├┬┘ │ ├─┤│' '' + printf '║%6s%s%6s║\n' '' '╩═╝┴└─┘┴└─└─┘ ╨─╨ ╩ └─┘┴└─ ┴ ┴ ┴┴─┘' '' + printf '╚%s╝\n\n' "$hbar" } init_action="$1" @@ -61,19 +62,17 @@ checkSuccess() { isHeader() { local title="$1" local width=52 - local inner=$((width - 6)) + local inner=$((width - 2)) local title_len=${#title} local total_pad=$((inner - title_len)) if (( total_pad < 0 )); then total_pad=0; fi local left_pad=$((total_pad / 2)) local right_pad=$((total_pad - left_pad)) - local bar - bar=$(printf '%*s' "$width" '' | tr ' ' '#') - echo "" - echo "$bar" - printf '###%*s%s%*s###\n' "$left_pad" '' "$title" "$right_pad" '' - echo "$bar" - echo "" + local hbar + hbar=$(printf '═%.0s' $(seq 1 "$inner")) + printf '\n╔%s╗\n' "$hbar" + printf '║%*s%s%*s║\n' "$left_pad" '' "$title" "$right_pad" '' + printf '╚%s╝\n\n' "$hbar" } # Original parameters for backward compatibility diff --git a/scripts/menu/message/markers.sh b/scripts/menu/message/markers.sh index 04bcc6a..191f863 100755 --- a/scripts/menu/message/markers.sh +++ b/scripts/menu/message/markers.sh @@ -46,18 +46,18 @@ function isHeader() { local title="$1" local width=52 - local inner=$((width - 6)) + local inner=$((width - 2)) local title_len=${#title} local total_pad=$((inner - title_len)) if (( total_pad < 0 )); then total_pad=0; fi local left_pad=$((total_pad / 2)) local right_pad=$((total_pad - left_pad)) - local bar - bar=$(printf '%*s' "$width" '' | tr ' ' '#') + # Double-line box. printf-repeat the horizontal rule so it stays aligned + # regardless of locale (tr can't emit a multibyte char per input byte). + local hbar + hbar=$(printf '═%.0s' $(seq 1 "$inner")) - echo "" - echo "$bar" - printf '###%*s%s%*s###\n' "$left_pad" '' "$title" "$right_pad" '' - echo "$bar" - echo "" + printf '\n╔%s╗\n' "$hbar" + printf '║%*s%s%*s║\n' "$left_pad" '' "$title" "$right_pad" '' + printf '╚%s╝\n\n' "$hbar" } diff --git a/scripts/source/files/generate_arrays.sh b/scripts/source/files/generate_arrays.sh index 45ab50e..365f8e6 100755 --- a/scripts/source/files/generate_arrays.sh +++ b/scripts/source/files/generate_arrays.sh @@ -24,25 +24,24 @@ isNotice() { echo -e "${YELLOW}NOTICE:${NC} $1"; } isHeader() { local title="$1" local width=52 - local inner=$((width - 6)) + local inner=$((width - 2)) local total_pad=$((inner - ${#title})) (( total_pad < 0 )) && total_pad=0 local left_pad=$((total_pad / 2)) local right_pad=$((total_pad - left_pad)) - local bar - bar=$(printf '%*s' "$width" '' | tr ' ' '#') - echo "" - echo "$bar" - printf '###%*s%s%*s###\n' "$left_pad" '' "$title" "$right_pad" '' - echo "$bar" - echo "" + local hbar + hbar=$(printf '═%.0s' $(seq 1 "$inner")) + printf '\n╔%s╗\n' "$hbar" + printf '║%*s%s%*s║\n' "$left_pad" '' "$title" "$right_pad" '' + printf '╚%s╝\n\n' "$hbar" } -echo " - ╦ ┬┌┐ ┬─┐┌─┐ ╭─╮ ╔═╗┌─┐┬─┐┌┬┐┌─┐┬ - ║ │├┴┐├┬┘├┤ │◉│ ╠═╝│ │├┬┘ │ ├─┤│ - ╩═╝┴└─┘┴└─└─┘ ╨─╨ ╩ └─┘┴└─ ┴ ┴ ┴┴─┘" -echo "" +hbar=$(printf '═%.0s' $(seq 1 50)) +printf '\n╔%s╗\n' "$hbar" +printf '║%6s%s%8s║\n' '' '╦ ┬┌┐ ┬─┐┌─┐ ╭─╮ ╔═╗┌─┐┬─┐┌┬┐┌─┐┬' '' +printf '║%6s%s%8s║\n' '' '║ │├┴┐├┬┘├┤ │◉│ ╠═╝│ │├┬┘ │ ├─┤│' '' +printf '║%6s%s%6s║\n' '' '╩═╝┴└─┘┴└─└─┘ ╨─╨ ╩ └─┘┴└─ ┴ ┴ ┴┴─┘' '' +printf '╚%s╝\n\n' "$hbar" isHeader "Regenerating Array Files" isNotice "Scanning scripts/ for subfolder arrays..." diff --git a/start.sh b/start.sh index 7b97f0b..61eda11 100755 --- a/start.sh +++ b/start.sh @@ -12,11 +12,12 @@ initial_command7="$7" displayLibrePortalLogo() { [[ "$LIBREPORTAL_SKIP_LOGO" == "1" ]] && return - echo " - ╦ ┬┌┐ ┬─┐┌─┐ ╭─╮ ╔═╗┌─┐┬─┐┌┬┐┌─┐┬ - ║ │├┴┐├┬┘├┤ │◉│ ╠═╝│ │├┬┘ │ ├─┤│ - ╩═╝┴└─┘┴└─└─┘ ╨─╨ ╩ └─┘┴└─ ┴ ┴ ┴┴─┘" - echo "" + local hbar; hbar=$(printf '═%.0s' $(seq 1 50)) + printf '\n╔%s╗\n' "$hbar" + printf '║%6s%s%8s║\n' '' '╦ ┬┌┐ ┬─┐┌─┐ ╭─╮ ╔═╗┌─┐┬─┐┌┬┐┌─┐┬' '' + printf '║%6s%s%8s║\n' '' '║ │├┴┐├┬┘├┤ │◉│ ╠═╝│ │├┬┘ │ ├─┤│' '' + printf '║%6s%s%6s║\n' '' '╩═╝┴└─┘┴└─└─┘ ╨─╨ ╩ └─┘┴└─ ┴ ┴ ┴┴─┘' '' + printf '╚%s╝\n\n' "$hbar" } showRunHelp()