style(cli): box section headers and the logo in double-line borders
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 <noreply@anthropic.com>
Signed-off-by: librelad <librelad@digitalangels.vip>
This commit is contained in:
parent
afaa43de36
commit
f7240cd096
25
init.sh
25
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
|
||||
|
||||
@ -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"
|
||||
}
|
||||
|
||||
@ -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..."
|
||||
|
||||
11
start.sh
11
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()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user