Breathing-block status indicator (blue/green/red) #10

Merged
yuri merged 6 commits from feat/breathing-block into main 2026-10-27 22:50:24 +01:00
2 changed files with 10 additions and 3 deletions
Showing only changes of commit 0630acf020 - Show all commits
+7 -1
View File
@@ -117,6 +117,12 @@ ui_quiet_run() {
# "solid blue, no breathing" on the console). Cap to the 16-color path. # "solid blue, no breathing" on the console). Cap to the 16-color path.
case "${TERM:-}" in linux*|console*) depth=16 ;; esac case "${TERM:-}" in linux*|console*) depth=16 ;; esac
# Per-depth frame interval: the console colour-pulse runs slower (a fast
# blue/grey flip reads as flicker — YuKu asked for half-to-third speed);
# the 256-colour breathe ramp keeps its 50ms.
local tick=0.05
(( depth == 16 )) && tick=0.15
local -a bg=() local -a bg=()
case "$depth" in case "$depth" in
# Deep-amplitude breathe: dark navy (17) to BRIGHT blue (45). Adjacent # Deep-amplitude breathe: dark navy (17) to BRIGHT blue (45). Adjacent
@@ -152,7 +158,7 @@ ui_quiet_run() {
fi fi
fi fi
f=$(( f + 1 )) f=$(( f + 1 ))
sleep 0.05 sleep "$tick"
done done
local rc=0 local rc=0
+3 -2
View File
@@ -41,8 +41,9 @@ _ub_paint() {
} }
_ub_busy_loop() { _ub_busy_loop() {
local depth pal=() i local depth pal=() i tick=0.05
depth=$(_ub_depth) depth=$(_ub_depth)
[[ "$depth" -eq 16 ]] && tick=0.15 # console pulse: slow, not flicker
case "$depth" in case "$depth" in
256) pal=(17 19 21 27 33 39 45 39 33 27 21 19) ;; # deep breathe: dark navy to bright blue 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 100 100) ;; # blue <-> dark grey, constant layout 16) pal=(44 44 100 100) ;; # blue <-> dark grey, constant layout
@@ -57,7 +58,7 @@ _ub_busy_loop() {
else else
printf '\r[%s] %s' "$i" "$_UB_MSG" >&"$_UB_FD" printf '\r[%s] %s' "$i" "$_UB_MSG" >&"$_UB_FD"
fi fi
sleep 0.05 || return 0 sleep "$tick" || return 0
done done
done done
} }