From 8c68ce28f7a21aab0a0bdf02bed7f229d93f4b83 Mon Sep 17 00:00:00 2001 From: steffen Date: Sat, 24 Jan 2026 18:27:03 +0000 Subject: [PATCH] Fix demo rotation and move demo to top --- dotfiles/install/install-linux-global.sh | 54 ++++++++++++------------ dotfiles/install/install-macos-user.sh | 54 ++++++++++++------------ dotfiles/ps1/ps1.sh | 15 +++---- 3 files changed, 61 insertions(+), 62 deletions(-) diff --git a/dotfiles/install/install-linux-global.sh b/dotfiles/install/install-linux-global.sh index 1e7bee8..3bee6a2 100644 --- a/dotfiles/install/install-linux-global.sh +++ b/dotfiles/install/install-linux-global.sh @@ -171,36 +171,36 @@ if [[ -t 0 ]]; then if [[ "$style_pack" == "contest" ]]; then echo echo "Style presets:" - echo " 1) Aurora - Powerline blocks, seasonal palette, two-line" - echo " Preview: [date time user] > [@host /path]" - echo " 2) Neon - Magenta/cyan cyber blocks, high contrast" - echo " Preview: [user time] > [@host /path]" - echo " 3) Forge - Warm copper blocks, heavy frame" - echo " Preview: [date time user] > [@host /path]" - echo " 4) Circuit - Green scanline, minimal rails" - echo " Preview: [user time] - @host /path" - echo " 5) Mono - Clean monochrome, fast read" - echo " Preview: [date time user] @host /path" - echo " 6) Git - Minimal with git capsule" - echo " Preview: [date time user] @host - /path (git)" - echo " 7) Hawolex - Winter neon, tech icons" - echo " Preview: [date time user] @host - /path" - echo " 8) HawolexV2 - Winter neon gradient" - echo " Preview: [date time user] @host - /path" - echo " 9) Demo - Cycles all themes every prompt" + echo " 1) Demo - Cycles all themes every prompt" echo " Preview: (auto-rotate)" + echo " 2) Aurora - Powerline blocks, seasonal palette, two-line" + echo " Preview: [date time user] > [@host /path]" + echo " 3) Neon - Magenta/cyan cyber blocks, high contrast" + echo " Preview: [user time] > [@host /path]" + echo " 4) Forge - Warm copper blocks, heavy frame" + echo " Preview: [date time user] > [@host /path]" + echo " 5) Circuit - Green scanline, minimal rails" + echo " Preview: [user time] - @host /path" + echo " 6) Mono - Clean monochrome, fast read" + echo " Preview: [date time user] @host /path" + echo " 7) Git - Minimal with git capsule" + echo " Preview: [date time user] @host - /path (git)" + echo " 8) Hawolex - Winter neon, tech icons" + echo " Preview: [date time user] @host - /path" + echo " 9) HawolexV2 - Winter neon gradient" + echo " Preview: [date time user] @host - /path" read -r -p "Choose style [1]: " style_pick case "${style_pick}" in - 2) style_choice="neon" ;; - 3) style_choice="forge" ;; - 4) style_choice="circuit" ;; - 5) style_choice="mono" ;; - 6) style_choice="git" ;; - 7) style_choice="hawolex" ;; - 8) style_choice="hawolexv2" ;; - 9) style_choice="demo" ;; - ""|1) style_choice="aurora" ;; - *) echo "Invalid choice, using aurora."; style_choice="aurora" ;; + 2) style_choice="aurora" ;; + 3) style_choice="neon" ;; + 4) style_choice="forge" ;; + 5) style_choice="circuit" ;; + 6) style_choice="mono" ;; + 7) style_choice="git" ;; + 8) style_choice="hawolex" ;; + 9) style_choice="hawolexv2" ;; + ""|1) style_choice="demo" ;; + *) echo "Invalid choice, using demo."; style_choice="demo" ;; esac elif [[ "$style_pack" == "custom" ]]; then diff --git a/dotfiles/install/install-macos-user.sh b/dotfiles/install/install-macos-user.sh index 636ac5c..ed014d4 100644 --- a/dotfiles/install/install-macos-user.sh +++ b/dotfiles/install/install-macos-user.sh @@ -147,36 +147,36 @@ if [[ -t 0 ]]; then if [[ "$style_pack" == "contest" ]]; then echo echo "Style presets:" - echo " 1) Aurora - Powerline blocks, seasonal palette, two-line" - echo " Preview: [date time user] > [@host /path]" - echo " 2) Neon - Magenta/cyan cyber blocks, high contrast" - echo " Preview: [user time] > [@host /path]" - echo " 3) Forge - Warm copper blocks, heavy frame" - echo " Preview: [date time user] > [@host /path]" - echo " 4) Circuit - Green scanline, minimal rails" - echo " Preview: [user time] - @host /path" - echo " 5) Mono - Clean monochrome, fast read" - echo " Preview: [date time user] @host /path" - echo " 6) Git - Minimal with git capsule" - echo " Preview: [date time user] @host - /path (git)" - echo " 7) Hawolex - Winter neon, tech icons" - echo " Preview: [date time user] @host - /path" - echo " 8) HawolexV2 - Winter neon gradient" - echo " Preview: [date time user] @host - /path" - echo " 9) Demo - Cycles all themes every prompt" + echo " 1) Demo - Cycles all themes every prompt" echo " Preview: (auto-rotate)" + echo " 2) Aurora - Powerline blocks, seasonal palette, two-line" + echo " Preview: [date time user] > [@host /path]" + echo " 3) Neon - Magenta/cyan cyber blocks, high contrast" + echo " Preview: [user time] > [@host /path]" + echo " 4) Forge - Warm copper blocks, heavy frame" + echo " Preview: [date time user] > [@host /path]" + echo " 5) Circuit - Green scanline, minimal rails" + echo " Preview: [user time] - @host /path" + echo " 6) Mono - Clean monochrome, fast read" + echo " Preview: [date time user] @host /path" + echo " 7) Git - Minimal with git capsule" + echo " Preview: [date time user] @host - /path (git)" + echo " 8) Hawolex - Winter neon, tech icons" + echo " Preview: [date time user] @host - /path" + echo " 9) HawolexV2 - Winter neon gradient" + echo " Preview: [date time user] @host - /path" read -r -p "Choose style [1]: " style_pick case "${style_pick}" in - 2) style_choice="neon" ;; - 3) style_choice="forge" ;; - 4) style_choice="circuit" ;; - 5) style_choice="mono" ;; - 6) style_choice="git" ;; - 7) style_choice="hawolex" ;; - 8) style_choice="hawolexv2" ;; - 9) style_choice="demo" ;; - ""|1) style_choice="aurora" ;; - *) echo "Invalid choice, using aurora."; style_choice="aurora" ;; + 2) style_choice="aurora" ;; + 3) style_choice="neon" ;; + 4) style_choice="forge" ;; + 5) style_choice="circuit" ;; + 6) style_choice="mono" ;; + 7) style_choice="git" ;; + 8) style_choice="hawolex" ;; + 9) style_choice="hawolexv2" ;; + ""|1) style_choice="demo" ;; + *) echo "Invalid choice, using demo."; style_choice="demo" ;; esac elif [[ "$style_pack" == "custom" ]]; then diff --git a/dotfiles/ps1/ps1.sh b/dotfiles/ps1/ps1.sh index c234d12..241ed2c 100644 --- a/dotfiles/ps1/ps1.sh +++ b/dotfiles/ps1/ps1.sh @@ -228,14 +228,13 @@ _ps1_demo_next() { "" "" "" "" "" "" "" ) local count=${#styles[@]} - if [[ -z "${__PS1_DEMO_INDEX+x}" ]]; then - __PS1_DEMO_INDEX=0 - else - __PS1_DEMO_INDEX=$(( (__PS1_DEMO_INDEX + 1) % count )) - fi - __PS1_DEMO_STYLE="${styles[$__PS1_DEMO_INDEX]}" - __PS1_DEMO_PACK="${packs[$__PS1_DEMO_INDEX]}" - __PS1_DEMO_HOLIDAY="${holidays[$__PS1_DEMO_INDEX]}" + local idx="${PS1_DEMO_INDEX:--1}" + idx=$(( (idx + 1) % count )) + PS1_DEMO_INDEX="$idx" + export PS1_DEMO_INDEX + __PS1_DEMO_STYLE="${styles[$idx]}" + __PS1_DEMO_PACK="${packs[$idx]}" + __PS1_DEMO_HOLIDAY="${holidays[$idx]}" } # ---- Load Git prompt helper (best effort) ----