From 91824d6160329c747ac93e55ba245a83b82a4d6a Mon Sep 17 00:00:00 2001 From: steffen Date: Sat, 24 Jan 2026 09:49:16 +0000 Subject: [PATCH] Rotate seasonal sunrise/work emojis - Add per-season emoji sets and daily rotation --- dotfiles/ps1/ps1.sh | 48 ++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 43 insertions(+), 5 deletions(-) diff --git a/dotfiles/ps1/ps1.sh b/dotfiles/ps1/ps1.sh index 7ceb7f1..88a2b97 100644 --- a/dotfiles/ps1/ps1.sh +++ b/dotfiles/ps1/ps1.sh @@ -90,6 +90,32 @@ _ps1_season() { } # Time-based emoji with seasonal accents (Europe/Oslo) +_ps1_pick_icon() { + local list_name="$1" + local season="$2" + local day + local -a list + local idx + local offset=0 + + day=$(TZ=Europe/Oslo date +%j) + case "$season" in + spring) offset=11 ;; + summer) offset=23 ;; + autumn) offset=37 ;; + *) offset=0 ;; + esac + + eval "list=(\"\${${list_name}[@]}\")" + if ((${#list[@]} == 0)); then + echo "" + return + fi + + idx=$(( (10#$day + offset) % ${#list[@]} )) + echo "${list[$idx]}" +} + _ps1_symbol() { local hh mm h m hh=$(TZ=Europe/Oslo date +%H); mm=$(TZ=Europe/Oslo date +%M) @@ -97,22 +123,34 @@ _ps1_symbol() { local season="${__PS1_SEASON:-winter}" local sunrise coffee work evening night + local -a sunrise_list work_list case "$season" in spring) - sunrise="🌷"; coffee="☕"; work="ðŸŒŋ"; evening="ðŸŒĪ"; night="🌙" + sunrise_list=( "🌷" "ðŸŒą" "ðŸĢ" "ðŸŒĪ" ) + work_list=( "ðŸŒŋ" "ðŸŠī" "🐝" "🌞" ) + coffee="☕"; evening="ðŸŒĪ"; night="🌙" ;; summer) - sunrise="🌞"; coffee="🧃"; work="ðŸŠī"; evening="🌇"; night="🌙" + sunrise_list=( "🌞" "🏖ïļ" "🌅" "ðŸŒĪ" ) + work_list=( "🏄" "🏖ïļ" "ðŸšĪ" "ðŸŒī" ) + coffee="🧃"; evening="🌇"; night="🌙" ;; autumn) - sunrise="🍁"; coffee="☕"; work="🍂"; evening="🌆"; night="🌙" + sunrise_list=( "🍁" "🍂" "ðŸŒŦïļ" "ðŸŒĶïļ" ) + work_list=( "🍂" "🍄" "🎃" "ðŸŠĩ" ) + coffee="☕"; evening="🌆"; night="🌙" ;; *) - sunrise="🏔ïļ"; coffee="☕"; work="❄ïļ"; evening="🌆"; night="🌙" + sunrise_list=( "🏔ïļ" "ðŸŒĻïļ" "❄ïļ" "🌌" ) + work_list=( "ðŸŽŋ" "⛷ïļ" "🏂" "🧊" ) + coffee="☕"; evening="🌆"; night="🌙" ;; esac + sunrise="$(_ps1_pick_icon sunrise_list "$season")" + work="$(_ps1_pick_icon work_list "$season")" + if (( h >= 5 && h <= 8 )); then echo "$sunrise" elif (( h >= 9 && h <= 10 )); then echo "$coffee" elif (( h == 11 && m < 30 )); then echo "ðŸĨŠ" @@ -216,9 +254,9 @@ ${Z2_BG}${Z2_FG} @\\h ${PATH_FG}${__PS1_PATH}${RST}${Z2_BG}${Z2_FG}${right}${RST _ps1_update() { __PS1_STATUS=$? + __PS1_SEASON="$(_ps1_season)" __PS1_SYM="$(_ps1_symbol)" __PS1_PATH="$(_ps1_path)" - __PS1_SEASON="$(_ps1_season)" if _ps1_has_nf; then __PS1_USE_NF=1; else __PS1_USE_NF=0; fi _ps1_set_prompt }