From 21233b90830abc36560bf587cc552e7e54e9f318 Mon Sep 17 00:00:00 2001 From: steffen Date: Sat, 24 Jan 2026 12:01:55 +0000 Subject: [PATCH] Update git emojis and move Hawolex to contest - Add git state emojis and branch wrapping - Move Hawolex to contest styles and update JSONs --- .context.json | 13 ++++- contest-styles.json | 29 ++++++---- dotfiles/install/install-linux-global.sh | 5 +- dotfiles/install/install-macos-user.sh | 5 +- dotfiles/ps1/ps1.sh | 71 ++++++++++++++++++------ 5 files changed, 90 insertions(+), 33 deletions(-) diff --git a/.context.json b/.context.json index 4ebd7b1..7856bea 100644 --- a/.context.json +++ b/.context.json @@ -168,10 +168,17 @@ "description": "Minimal blocks with git capsule when in repo.", "layout": "two-line, git capsule on line 2", "preview": "[date time user] @host - /path (git)" + }, + { + "id": "hawolex", + "name": "Hawolex", + "description": "Winter neon with tech icons, contest layout.", + "layout": "two-line, contest layout", + "preview": "[date time user] @host - /path" } ], "config": { - "env": "PS1_STYLE=aurora|neon|forge|circuit|mono|git; PS1_STYLE_PACK=standard|contest|holiday; PS1_CONTEST_LAYOUT=day-time-user|user-time|time-user|day-time; PS1_HOLIDAY=christmas|easter|halloween|valentine|thanksgiving|newyear|hawolex", + "env": "PS1_STYLE=aurora|neon|forge|circuit|mono|git|hawolex; PS1_STYLE_PACK=standard|contest|holiday; PS1_CONTEST_LAYOUT=day-time-user|user-time|time-user|day-time; PS1_HOLIDAY=christmas|easter|halloween|valentine|thanksgiving|newyear", "config_file_keys": [ "PS1_STYLE", "PS1_STYLE_PACK", @@ -375,7 +382,9 @@ "coffee": "โ˜•", "evening": "๐ŸŒ†", "night": "๐ŸŒ™" - }, + } + }, + "style_accents": { "hawolex": { "sunrise": [ "๐Ÿ’ป", diff --git a/contest-styles.json b/contest-styles.json index ccdfbfd..11272b6 100644 --- a/contest-styles.json +++ b/contest-styles.json @@ -98,16 +98,6 @@ "evening": "๐ŸŒ†", "night": "๐ŸŒ™" } - }, - "hawolex": { - "palette": { "Z1_BG": 54, "Z1_FG": 255, "Z2_BG": 31, "Z2_FG": 255, "PATH_FG": 230, "FRAME": 24 }, - "emoji_set": { - "sunrise": [ "๐Ÿ’ป", "๐Ÿš—", "๐Ÿ”Š", "๐ŸŽฎ" ], - "work": [ "๐ŸŽง", "๐Ÿ•น๏ธ", "๐Ÿ“Ÿ", "๐Ÿงฉ" ], - "coffee": "โ˜•", - "evening": "๐ŸŒ†", - "night": "๐ŸŒ™" - } } } }, @@ -214,6 +204,25 @@ "frame": 60 }, "preview": "[date time user] @host - /path (git)" + }, + { + "id": "hawolex", + "name": "Hawolex", + "tagline": "Winter neon, tech icons", + "description": "Contest layout with winter-strong palette and tech emojis.", + "layout": { + "line1": "date time user | @host - /path", + "line2": "status arrow + emoji" + }, + "colors": { + "zone1_bg": 54, + "zone1_fg": 255, + "zone2_bg": 31, + "zone2_fg": 255, + "path_fg": 230, + "frame": 24 + }, + "preview": "[date time user] @host - /path" } ], "seasonal_palettes": { diff --git a/dotfiles/install/install-linux-global.sh b/dotfiles/install/install-linux-global.sh index ed6d9ed..5c8812d 100644 --- a/dotfiles/install/install-linux-global.sh +++ b/dotfiles/install/install-linux-global.sh @@ -101,7 +101,6 @@ if [[ -t 0 ]]; then echo " 4) Valentine" echo " 5) Thanksgiving" echo " 6) New Year" - echo " 7) Hawolex" read -r -p "Choose [1]: " holiday_pick case "${holiday_pick}" in 2) holiday_choice="easter" ;; @@ -109,7 +108,6 @@ if [[ -t 0 ]]; then 4) holiday_choice="valentine" ;; 5) holiday_choice="thanksgiving" ;; 6) holiday_choice="newyear" ;; - 7) holiday_choice="hawolex" ;; ""|1) holiday_choice="christmas" ;; *) echo "Invalid choice, using christmas."; holiday_choice="christmas" ;; esac @@ -151,6 +149,8 @@ if [[ -t 0 ]]; then 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" read -r -p "Choose style [1]: " style_pick case "${style_pick}" in 2) style_choice="neon" ;; @@ -158,6 +158,7 @@ if [[ -t 0 ]]; then 4) style_choice="circuit" ;; 5) style_choice="mono" ;; 6) style_choice="git" ;; + 7) style_choice="hawolex" ;; ""|1) style_choice="aurora" ;; *) echo "Invalid choice, using aurora."; style_choice="aurora" ;; esac diff --git a/dotfiles/install/install-macos-user.sh b/dotfiles/install/install-macos-user.sh index cfad87d..22e8310 100644 --- a/dotfiles/install/install-macos-user.sh +++ b/dotfiles/install/install-macos-user.sh @@ -77,7 +77,6 @@ if [[ -t 0 ]]; then echo " 4) Valentine" echo " 5) Thanksgiving" echo " 6) New Year" - echo " 7) Hawolex" read -r -p "Choose [1]: " holiday_pick case "${holiday_pick}" in 2) holiday_choice="easter" ;; @@ -85,7 +84,6 @@ if [[ -t 0 ]]; then 4) holiday_choice="valentine" ;; 5) holiday_choice="thanksgiving" ;; 6) holiday_choice="newyear" ;; - 7) holiday_choice="hawolex" ;; ""|1) holiday_choice="christmas" ;; *) echo "Invalid choice, using christmas."; holiday_choice="christmas" ;; esac @@ -127,6 +125,8 @@ if [[ -t 0 ]]; then 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" read -r -p "Choose style [1]: " style_pick case "${style_pick}" in 2) style_choice="neon" ;; @@ -134,6 +134,7 @@ if [[ -t 0 ]]; then 4) style_choice="circuit" ;; 5) style_choice="mono" ;; 6) style_choice="git" ;; + 7) style_choice="hawolex" ;; ""|1) style_choice="aurora" ;; *) echo "Invalid choice, using aurora."; style_choice="aurora" ;; esac diff --git a/dotfiles/ps1/ps1.sh b/dotfiles/ps1/ps1.sh index f341e2f..a0bcd4b 100644 --- a/dotfiles/ps1/ps1.sh +++ b/dotfiles/ps1/ps1.sh @@ -89,11 +89,11 @@ _ps1_season() { fi } -# Style selection (aurora/neon/forge/circuit/mono/git) -# PS1_STYLE=aurora|neon|forge|circuit|mono|git +# Style selection (aurora/neon/forge/circuit/mono/git/hawolex) +# PS1_STYLE=aurora|neon|forge|circuit|mono|git|hawolex # PS1_STYLE_PACK=standard|contest|holiday # PS1_CONTEST_LAYOUT=day-time-user|user-time|time-user|day-time -# PS1_HOLIDAY=christmas|easter|halloween|valentine|thanksgiving|newyear|hawolex +# PS1_HOLIDAY=christmas|easter|halloween|valentine|thanksgiving|newyear # Also reads config from /etc/ps1-style or ~/.config/ps1/style _ps1_style_config() { local cfg="" @@ -155,6 +155,36 @@ __try_source_git_prompt() { } __try_source_git_prompt >/dev/null 2>&1 +__git_capsule() { + if ! declare -F __git_ps1 >/dev/null 2>&1; then + return 0 + fi + + local info status="" + local clean="โœจ" + local dirty="๐Ÿ”จ" + local staged="๐Ÿ“Œ" + local untracked="๐Ÿงท" + local stashed="๐Ÿ“ฆ" + + info="$(__git_ps1 "%s" 2>/dev/null)" + [[ -z "$info" ]] && return 0 + + if [[ "$info" == *"*"* ]]; then status+=" $dirty"; fi + if [[ "$info" == *"+"* ]]; then status+=" $staged"; fi + if [[ "$info" == *"%"* ]]; then status+=" $untracked"; fi + if [[ "$info" == *"$"* ]]; then status+=" $stashed"; fi + if [[ -z "$status" ]]; then status=" $clean"; fi + + info="${info//\%/}" + info="${info//\*/}" + info="${info//\+/}" + info="${info//\$/}" + info="$(printf "%s" "$info" | xargs)" + + printf " โŸฆ%sโŸง%s" "$info" "$status" +} + __git_capsule() { if declare -F __git_ps1 >/dev/null 2>&1; then __git_ps1 " (%s)" 2>/dev/null @@ -181,6 +211,7 @@ _ps1_pick_icon() { valentine) offset=109 ;; thanksgiving) offset=131 ;; newyear) offset=151 ;; + hawolex) offset=173 ;; *) offset=0 ;; esac @@ -206,7 +237,12 @@ _ps1_symbol() { local sunrise coffee work evening night local -a sunrise_list work_list - if [[ "$pack" == "contest" ]]; then + if [[ "$__PS1_STYLE" == "hawolex" ]]; then + rot_season="hawolex" + sunrise_list=( "๐Ÿ’ป" "๐Ÿš—" "๐Ÿ”Š" "๐ŸŽฎ" ) + work_list=( "๐ŸŽง" "๐Ÿ•น๏ธ" "๐Ÿ“Ÿ" "๐Ÿงฉ" ) + coffee="โ˜•"; evening="๐ŸŒ†"; night="๐ŸŒ™" + elif [[ "$pack" == "contest" ]]; then rot_season="winter" sunrise_list=( "โšก๏ธ" "๐Ÿ›ฐ๏ธ" "๐Ÿงฌ" "๐Ÿง " ) work_list=( "๐Ÿ› ๏ธ" "๐Ÿ’พ" "๐Ÿงช" "๐Ÿงฉ" ) @@ -244,11 +280,6 @@ _ps1_symbol() { work_list=( "๐Ÿ—“๏ธ" "โณ" "๐Ÿš€" "โœจ" ) coffee="โ˜•"; evening="๐ŸŒ†"; night="๐ŸŒ™" ;; - hawolex) - sunrise_list=( "๐Ÿ’ป" "๐Ÿš—" "๐Ÿ”Š" "๐ŸŽฎ" ) - work_list=( "๐ŸŽง" "๐Ÿ•น๏ธ" "๐Ÿ“Ÿ" "๐Ÿงฉ" ) - coffee="โ˜•"; evening="๐ŸŒ†"; night="๐ŸŒ™" - ;; *) sunrise_list=( "๐ŸŽ‰" "โœจ" "๐ŸŽŠ" "๐ŸŒŸ" ) work_list=( "๐Ÿงฉ" "๐Ÿ› ๏ธ" "๐Ÿ’พ" "๐Ÿงช" ) @@ -381,14 +412,6 @@ _ps1_set_prompt() { PATH_FG="\[\e[38;5;229m\]" FRAME="\[\e[38;5;19m\]" ;; - hawolex) - Z1_BG="\[\e[48;5;54m\]" - Z1_FG="\[\e[38;5;255m\]" - Z2_BG="\[\e[48;5;31m\]" - Z2_FG="\[\e[38;5;255m\]" - PATH_FG="\[\e[38;5;230m\]" - FRAME="\[\e[38;5;24m\]" - ;; *) Z1_BG="\[\e[48;5;24m\]" Z1_FG="\[\e[38;5;255m\]" @@ -523,6 +546,7 @@ ${PREFIX}${M_FG}โŸฆ${L1}โŸง ${M_DIM}${HOST_PART}${PATH_SEP}${M_FG}${PATH_PART}${ git) export GIT_PS1_SHOWDIRTYSTATE=1 export GIT_PS1_SHOWSTASHSTATE=1 + export GIT_PS1_SHOWUNTRACKEDFILES=1 local G_FRAME="\[\e[38;5;60m\]" local G_Z1_BG="\[\e[48;5;61m\]" local G_Z1_FG="\[\e[38;5;255m\]" @@ -536,6 +560,19 @@ ${G_Z1_BG}${G_Z1_FG}${left} ${L1} ${RST}${G_Z1_BG}${G_Z2_BG}${G_Z2_FG}${sep}${RS ${G_Z2_BG}${G_Z2_FG} ${HOST_PART}${PATH_SEP}${G_PATH_FG}${PATH_PART} ${RST}${G_Z2_BG}${G_Z2_FG}${right}${RST}\ \n${G_FRAME}โ•ฐโ”€โ”€ ${RST}${prompt_sym} ${__PS1_SYM}${GIT_INFO} " ;; + hawolex) + local H_FRAME="\[\e[38;5;24m\]" + local H_Z1_BG="\[\e[48;5;54m\]" + local H_Z1_FG="\[\e[38;5;255m\]" + local H_Z2_BG="\[\e[48;5;31m\]" + local H_Z2_FG="\[\e[38;5;255m\]" + local H_PATH_FG="\[\e[38;5;230m\]" + PS1="\ +${PREFIX}${H_FRAME}โ•ญโ”€${RST}\ +${H_Z1_BG}${H_Z1_FG}${left} ${L1} ${RST}${H_Z1_BG}${H_Z2_BG}${H_Z2_FG}${sep}${RST}\ +${H_Z2_BG}${H_Z2_FG} ${HOST_PART}${PATH_SEP}${H_PATH_FG}${PATH_PART} ${RST}${H_Z2_BG}${H_Z2_FG}${right}${RST}\ +\n${H_FRAME}โ•ฐโ”€โ”€ ${RST}${prompt_sym} ${__PS1_SYM} " + ;; *) # aurora (default) PS1="\