From 98ae44cc3b11ca05dbe13741579d7b098e298b28 Mon Sep 17 00:00:00 2001 From: steffen Date: Sat, 24 Jan 2026 16:15:28 +0000 Subject: [PATCH] Add layout order selection for seasonal prompts --- .context.json | 4 +-- README.md | 2 ++ dotfiles/install/install-linux-global.sh | 30 ++++++++++++++++++++- dotfiles/install/install-macos-user.sh | 34 +++++++++++++++++++++--- dotfiles/ps1/ps1.sh | 6 +++-- 5 files changed, 68 insertions(+), 8 deletions(-) diff --git a/.context.json b/.context.json index 6152e3e..2b59f7b 100644 --- a/.context.json +++ b/.context.json @@ -37,7 +37,7 @@ "PS1 only / Banner only / Both", "PS1 mode: Single season / Dynamic / Contest / Holidays / Custom (if PS1 selected)", "Season pick (if single season)", - "Contest layout selection (if contest/holidays)", + "Layout order selection (seasonal/contest/holidays)", "Style preset selection (if contest)", "Holiday selection (if holidays)", "Custom style selection (if custom)", @@ -60,7 +60,7 @@ "prompts": [ "PS1 mode: Single season / Dynamic / Contest / Holidays / Custom", "Season pick (if single season)", - "Contest layout selection (if contest/holidays)", + "Layout order selection (seasonal/contest/holidays)", "Style preset selection (if contest)", "Holiday selection (if holidays)", "Custom style selection (if custom)", diff --git a/README.md b/README.md index bbd8dd2..eadc563 100644 --- a/README.md +++ b/README.md @@ -79,11 +79,13 @@ Linux/WSL: - PS1 only / Banner only / Both - PS1 modes: Single season, Dynamic season, Contest pack, Holidays pack, Custom pack - Dynamic season auto-switches by time of year (Spring: Mar–May, Summer: Jun–Aug, Autumn: Sep–Nov 14, Winter: Nov 15–Feb) +- Layout order (day-time-user, user-time, time-user, day-time) for seasonal and contest modes macOS: - PS1 modes: Single season, Dynamic season, Contest pack, Holidays pack, Custom pack - Dynamic season auto-switches by time of year (same ranges as Linux) +- Layout order (day-time-user, user-time, time-user, day-time) for seasonal and contest modes --- diff --git a/dotfiles/install/install-linux-global.sh b/dotfiles/install/install-linux-global.sh index 745ed7e..45e12e9 100644 --- a/dotfiles/install/install-linux-global.sh +++ b/dotfiles/install/install-linux-global.sh @@ -70,10 +70,38 @@ if [[ -t 0 ]]; then esac style_pack="standard" + contest_layout="day-time-user" + echo "Layout order:" + echo " 1) day-time-user" + echo " 2) user-time" + echo " 3) time-user" + echo " 4) day-time" + read -r -p "Choose [1]: " layout_pick + case "${layout_pick}" in + 2) contest_layout="user-time" ;; + 3) contest_layout="time-user" ;; + 4) contest_layout="day-time" ;; + ""|1) contest_layout="day-time-user" ;; + *) echo "Invalid choice, using day-time-user."; contest_layout="day-time-user" ;; + esac ;; 2) season_mode="dynamic" style_pack="standard" + contest_layout="day-time-user" + echo "Layout order:" + echo " 1) day-time-user" + echo " 2) user-time" + echo " 3) time-user" + echo " 4) day-time" + read -r -p "Choose [1]: " layout_pick + case "${layout_pick}" in + 2) contest_layout="user-time" ;; + 3) contest_layout="time-user" ;; + 4) contest_layout="day-time" ;; + ""|1) contest_layout="day-time-user" ;; + *) echo "Invalid choice, using day-time-user."; contest_layout="day-time-user" ;; + esac ;; ""|3) season_mode="static" @@ -284,7 +312,7 @@ if [[ "$install_ps1" -eq 1 ]]; then { printf 'PS1_STYLE=%s\n' "$style_choice" printf 'PS1_STYLE_PACK=%s\n' "$style_pack" - if [[ "$style_pack" == "contest" || "$style_pack" == "holiday" ]]; then + if [[ "$style_pack" == "contest" || "$style_pack" == "holiday" || "$style_pack" == "standard" ]]; then printf 'PS1_CONTEST_LAYOUT=%s\n' "$contest_layout" fi if [[ "$style_pack" == "holiday" ]]; then diff --git a/dotfiles/install/install-macos-user.sh b/dotfiles/install/install-macos-user.sh index 8ec5cbf..79d5dfd 100644 --- a/dotfiles/install/install-macos-user.sh +++ b/dotfiles/install/install-macos-user.sh @@ -45,11 +45,39 @@ if [[ -t 0 ]]; then *) echo "Invalid choice, using winter."; season_choice="winter" ;; esac - style_pack="standard" - ;; + style_pack="standard" + contest_layout="day-time-user" + echo "Layout order:" + echo " 1) day-time-user" + echo " 2) user-time" + echo " 3) time-user" + echo " 4) day-time" + read -r -p "Choose [1]: " layout_pick + case "${layout_pick}" in + 2) contest_layout="user-time" ;; + 3) contest_layout="time-user" ;; + 4) contest_layout="day-time" ;; + ""|1) contest_layout="day-time-user" ;; + *) echo "Invalid choice, using day-time-user."; contest_layout="day-time-user" ;; + esac + ;; 2) season_mode="dynamic" style_pack="standard" + contest_layout="day-time-user" + echo "Layout order:" + echo " 1) day-time-user" + echo " 2) user-time" + echo " 3) time-user" + echo " 4) day-time" + read -r -p "Choose [1]: " layout_pick + case "${layout_pick}" in + 2) contest_layout="user-time" ;; + 3) contest_layout="time-user" ;; + 4) contest_layout="day-time" ;; + ""|1) contest_layout="day-time-user" ;; + *) echo "Invalid choice, using day-time-user."; contest_layout="day-time-user" ;; + esac ;; ""|3) season_mode="static" @@ -205,7 +233,7 @@ chmod 0644 "$SEASON_FILE" { printf 'PS1_STYLE=%s\n' "$style_choice" printf 'PS1_STYLE_PACK=%s\n' "$style_pack" - if [[ "$style_pack" == "contest" || "$style_pack" == "holiday" ]]; then + if [[ "$style_pack" == "contest" || "$style_pack" == "holiday" || "$style_pack" == "standard" ]]; then printf 'PS1_CONTEST_LAYOUT=%s\n' "$contest_layout" fi if [[ "$style_pack" == "holiday" ]]; then diff --git a/dotfiles/ps1/ps1.sh b/dotfiles/ps1/ps1.sh index 60a76ab..7fe0d6c 100644 --- a/dotfiles/ps1/ps1.sh +++ b/dotfiles/ps1/ps1.sh @@ -622,14 +622,16 @@ _ps1_set_prompt() { local PATH_PART="${__PS1_PATH}" local PATH_SEP=" " local END_PAD=" " - if [[ "$__PS1_STYLE_PACK" == "contest" || "$__PS1_STYLE_PACK" == "holiday" ]]; then - local layout="${__PS1_CONTEST_LAYOUT:-day-time-user}" + local layout="${__PS1_CONTEST_LAYOUT:-day-time-user}" + if [[ "$__PS1_STYLE_PACK" == "contest" || "$__PS1_STYLE_PACK" == "holiday" || "$__PS1_STYLE_PACK" == "standard" ]]; then case "$layout" in user-time) L1="\\u \\A" ;; time-user) L1="\\A \\u" ;; day-time) L1="\\d \\A" ;; *) L1="\\d \\A \\u" ;; esac + fi + if [[ "$__PS1_STYLE_PACK" == "contest" || "$__PS1_STYLE_PACK" == "holiday" ]]; then HOST_PART="@\\h - ${__PS1_PATH}" PATH_PART="" PATH_SEP=""