From 4a53155c7ebba386e2058e193d41a9997254e1c8 Mon Sep 17 00:00:00 2001 From: Pathfinder Date: Tue, 27 Oct 2026 22:45:43 +0100 Subject: [PATCH] TTY pulse: constant layout, blue <-> dark grey (no more block-off) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The on/off pulse shifted the whole line by one character during the dark frames (off-frame printed one space fewer than the block frame). Per YuKu: keep the block ALWAYS present and alternate its colour instead — blue (44) <-> dark grey (100, bright black). Layout is constant, pulse is colour-based, nothing moves but the block itself. Also: disable_selinux now mkdir -p's /etc/selinux before writing a fresh config (harness caught a die on a missing parent dir). --- lib/common.sh | 25 ++++++++++--------------- lib/ui-block.sh | 8 ++------ 2 files changed, 12 insertions(+), 21 deletions(-) diff --git a/lib/common.sh b/lib/common.sh index 9426176..db04d3c 100644 --- a/lib/common.sh +++ b/lib/common.sh @@ -123,9 +123,10 @@ ui_quiet_run() { # shades must differ enough to survive flicker fusion — a subtle ramp # at 20fps reads as a solid block (VM-proven). 256) bg=( "48;5;17" "48;5;19" "48;5;21" "48;5;27" "48;5;33" "48;5;39" "48;5;45" "48;5;39" "48;5;33" "48;5;27" "48;5;21" "48;5;19" ) ;; - # On/off pulse, NOT shade alternation: console blues fuse to solid. - # Empty element = frame without the block (block breathes in/out). - 16) bg=( "44" "44" "" "" ) ;; + # Colour pulse with CONSTANT layout: blue <-> dark grey (bright black). + # Never remove the block on a frame — a missing block shifted the + # whole line by one char on the console (VM-proven). + 16) bg=( "44" "44" "100" "100" ) ;; esac local -a ch=( "|" "/" "-" "\\" ) @@ -138,19 +139,10 @@ ui_quiet_run() { | tail -n 1 || true) if (( depth >= 16 )); then local code="${bg[$(( f % ${#bg[@]} ))]}" - if [[ -n "$code" ]]; then - if [[ -n "$cur" ]]; then - printf '\r\033[%sm \033[0m %s: %s' "$code" "$msg" "$cur" >&2 - else - printf '\r\033[%sm \033[0m %s' "$code" "$msg" >&2 - fi + if [[ -n "$cur" ]]; then + printf '\r\033[%sm \033[0m %s: %s' "$code" "$msg" "$cur" >&2 else - # block "breathes out": just the text that frame - if [[ -n "$cur" ]]; then - printf '\r %s: %s' "$msg" "$cur" >&2 - else - printf '\r %s' "$msg" >&2 - fi + printf '\r\033[%sm \033[0m %s' "$code" "$msg" >&2 fi else if [[ -n "$cur" ]]; then @@ -357,6 +349,9 @@ disable_selinux() { sudo cp "$cfg" "${cfg}.bkp.$(date +%F)" sudo sed -i 's/^SELINUX=.*/SELINUX=disabled/' "$cfg" else + # belt-and-suspenders: on real Fedora /etc/selinux always exists, but + # do not die if it somehow does not + sudo mkdir -p "$(dirname "$cfg")" printf 'SELINUX=disabled\nSELINUXTYPE=targeted\n' | sudo tee "$cfg" >/dev/null fi ok "SELINUX=disabled written to $cfg (backup saved). Reboot to apply." diff --git a/lib/ui-block.sh b/lib/ui-block.sh index f5d36a6..7210ecf 100644 --- a/lib/ui-block.sh +++ b/lib/ui-block.sh @@ -45,7 +45,7 @@ _ub_busy_loop() { depth=$(_ub_depth) case "$depth" in 256) pal=(17 19 21 27 33 39 45 39 33 27 21 19) ;; # deep breathe: dark navy to bright blue - 16) pal=(44 44 "" "") ;; # on/off pulse: console blues fuse + 16) pal=(44 44 100 100) ;; # blue <-> dark grey, constant layout *) pal=("|" "/" "-" "\\") ;; # last-resort spinner esac while :; do @@ -53,11 +53,7 @@ _ub_busy_loop() { if [[ "$depth" -eq 256 ]]; then _ub_paint "48;5;$i" "$_UB_MSG" # 256-colour cube background elif [[ "$depth" -eq 16 ]]; then - if [[ -n "$i" ]]; then - _ub_paint "$i" "$_UB_MSG" # plain ANSI background (blue) - else - printf '\r %s' "$_UB_MSG" >&"$_UB_FD" # block breathes out - fi + _ub_paint "$i" "$_UB_MSG" # blue <-> dark grey pulse else printf '\r[%s] %s' "$i" "$_UB_MSG" >&"$_UB_FD" fi