Add Git style and strengthen Hawolex

- Add git preset with repo capsule

- Boost Hawolex palette contrast

- Update context and contest JSONs
This commit is contained in:
2026-01-24 11:49:32 +00:00
parent 808fcc774f
commit 059a642ff5
5 changed files with 76 additions and 8 deletions

View File

@@ -161,10 +161,17 @@
"description": "Clean monochrome, fast read, low noise.", "description": "Clean monochrome, fast read, low noise.",
"layout": "two-line, minimal", "layout": "two-line, minimal",
"preview": "[date time user] @host /path" "preview": "[date time user] @host /path"
},
{
"id": "git",
"name": "Git",
"description": "Minimal blocks with git capsule when in repo.",
"layout": "two-line, git capsule on line 2",
"preview": "[date time user] @host - /path (git)"
} }
], ],
"config": { "config": {
"env": "PS1_STYLE=aurora|neon|forge|circuit|mono; 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; 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",
"config_file_keys": [ "config_file_keys": [
"PS1_STYLE", "PS1_STYLE",
"PS1_STYLE_PACK", "PS1_STYLE_PACK",

View File

@@ -100,7 +100,7 @@
} }
}, },
"hawolex": { "hawolex": {
"palette": { "Z1_BG": 61, "Z1_FG": 255, "Z2_BG": 37, "Z2_FG": 255, "PATH_FG": 194, "FRAME": 60 }, "palette": { "Z1_BG": 54, "Z1_FG": 255, "Z2_BG": 31, "Z2_FG": 255, "PATH_FG": 230, "FRAME": 24 },
"emoji_set": { "emoji_set": {
"sunrise": [ "💻", "🚗", "🔊", "🎮" ], "sunrise": [ "💻", "🚗", "🔊", "🎮" ],
"work": [ "🎧", "🕹️", "📟", "🧩" ], "work": [ "🎧", "🕹️", "📟", "🧩" ],
@@ -195,6 +195,25 @@
"fg_dim": 240 "fg_dim": 240
}, },
"preview": "[date time user] @host /path" "preview": "[date time user] @host /path"
},
{
"id": "git",
"name": "Git",
"tagline": "Repo-aware minimalism",
"description": "Minimal blocks with git capsule on line 2.",
"layout": {
"line1": "date time user | @host - /path",
"line2": "status arrow + emoji + git"
},
"colors": {
"zone1_bg": 61,
"zone1_fg": 255,
"zone2_bg": 37,
"zone2_fg": 255,
"path_fg": 194,
"frame": 60
},
"preview": "[date time user] @host - /path (git)"
} }
], ],
"seasonal_palettes": { "seasonal_palettes": {

View File

@@ -149,12 +149,15 @@ if [[ -t 0 ]]; then
echo " Preview: [user time] - @host /path" echo " Preview: [user time] - @host /path"
echo " 5) Mono - Clean monochrome, fast read" echo " 5) Mono - Clean monochrome, fast read"
echo " Preview: [date time user] @host /path" echo " Preview: [date time user] @host /path"
echo " 6) Git - Minimal with git capsule"
echo " Preview: [date time user] @host - /path (git)"
read -r -p "Choose style [1]: " style_pick read -r -p "Choose style [1]: " style_pick
case "${style_pick}" in case "${style_pick}" in
2) style_choice="neon" ;; 2) style_choice="neon" ;;
3) style_choice="forge" ;; 3) style_choice="forge" ;;
4) style_choice="circuit" ;; 4) style_choice="circuit" ;;
5) style_choice="mono" ;; 5) style_choice="mono" ;;
6) style_choice="git" ;;
""|1) style_choice="aurora" ;; ""|1) style_choice="aurora" ;;
*) echo "Invalid choice, using aurora."; style_choice="aurora" ;; *) echo "Invalid choice, using aurora."; style_choice="aurora" ;;
esac esac

View File

@@ -125,12 +125,15 @@ if [[ -t 0 ]]; then
echo " Preview: [user time] - @host /path" echo " Preview: [user time] - @host /path"
echo " 5) Mono - Clean monochrome, fast read" echo " 5) Mono - Clean monochrome, fast read"
echo " Preview: [date time user] @host /path" echo " Preview: [date time user] @host /path"
echo " 6) Git - Minimal with git capsule"
echo " Preview: [date time user] @host - /path (git)"
read -r -p "Choose style [1]: " style_pick read -r -p "Choose style [1]: " style_pick
case "${style_pick}" in case "${style_pick}" in
2) style_choice="neon" ;; 2) style_choice="neon" ;;
3) style_choice="forge" ;; 3) style_choice="forge" ;;
4) style_choice="circuit" ;; 4) style_choice="circuit" ;;
5) style_choice="mono" ;; 5) style_choice="mono" ;;
6) style_choice="git" ;;
""|1) style_choice="aurora" ;; ""|1) style_choice="aurora" ;;
*) echo "Invalid choice, using aurora."; style_choice="aurora" ;; *) echo "Invalid choice, using aurora."; style_choice="aurora" ;;
esac esac

View File

@@ -89,8 +89,8 @@ _ps1_season() {
fi fi
} }
# Style selection (aurora/neon/forge/circuit/mono) # Style selection (aurora/neon/forge/circuit/mono/git)
# PS1_STYLE=aurora|neon|forge|circuit|mono # PS1_STYLE=aurora|neon|forge|circuit|mono|git
# PS1_STYLE_PACK=standard|contest|holiday # PS1_STYLE_PACK=standard|contest|holiday
# PS1_CONTEST_LAYOUT=day-time-user|user-time|time-user|day-time # 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|hawolex
@@ -141,6 +141,26 @@ _ps1_holiday() {
echo "$holiday" echo "$holiday"
} }
# ---- Load Git prompt helper (best effort) ----
__try_source_git_prompt() {
local candidates=(
"/usr/share/git/completion/git-prompt.sh"
"/usr/local/etc/bash_completion.d/git-prompt.sh"
"/etc/bash_completion.d/git-prompt.sh"
)
for f in "${candidates[@]}"; do
[[ -r "$f" ]] && source "$f" && return 0
done
return 1
}
__try_source_git_prompt >/dev/null 2>&1
__git_capsule() {
if declare -F __git_ps1 >/dev/null 2>&1; then
__git_ps1 " (%s)" 2>/dev/null
fi
}
# Time-based emoji with seasonal accents (Europe/Oslo) # Time-based emoji with seasonal accents (Europe/Oslo)
_ps1_pick_icon() { _ps1_pick_icon() {
local list_name="$1" local list_name="$1"
@@ -362,12 +382,12 @@ _ps1_set_prompt() {
FRAME="\[\e[38;5;19m\]" FRAME="\[\e[38;5;19m\]"
;; ;;
hawolex) hawolex)
Z1_BG="\[\e[48;5;61m\]" Z1_BG="\[\e[48;5;54m\]"
Z1_FG="\[\e[38;5;255m\]" Z1_FG="\[\e[38;5;255m\]"
Z2_BG="\[\e[48;5;37m\]" Z2_BG="\[\e[48;5;31m\]"
Z2_FG="\[\e[38;5;255m\]" Z2_FG="\[\e[38;5;255m\]"
PATH_FG="\[\e[38;5;194m\]" PATH_FG="\[\e[38;5;230m\]"
FRAME="\[\e[38;5;60m\]" FRAME="\[\e[38;5;24m\]"
;; ;;
*) *)
Z1_BG="\[\e[48;5;24m\]" Z1_BG="\[\e[48;5;24m\]"
@@ -500,6 +520,22 @@ ${C_DIM}━${RST}${C_FG}${HOST_PART}${RST}${PATH_SEP}${C_PATH}${PATH_PART}${RST}
${PREFIX}${M_FG}${L1}${M_DIM}${HOST_PART}${PATH_SEP}${M_FG}${PATH_PART}${RST}\ ${PREFIX}${M_FG}${L1}${M_DIM}${HOST_PART}${PATH_SEP}${M_FG}${PATH_PART}${RST}\
\n${M_DIM}└─${RST}${prompt_sym} ${__PS1_SYM} " \n${M_DIM}└─${RST}${prompt_sym} ${__PS1_SYM} "
;; ;;
git)
export GIT_PS1_SHOWDIRTYSTATE=1
export GIT_PS1_SHOWSTASHSTATE=1
local G_FRAME="\[\e[38;5;60m\]"
local G_Z1_BG="\[\e[48;5;61m\]"
local G_Z1_FG="\[\e[38;5;255m\]"
local G_Z2_BG="\[\e[48;5;37m\]"
local G_Z2_FG="\[\e[38;5;255m\]"
local G_PATH_FG="\[\e[38;5;194m\]"
local GIT_INFO="$(__git_capsule)"
PS1="\
${PREFIX}${G_FRAME}╭─${RST}\
${G_Z1_BG}${G_Z1_FG}${left} ${L1} ${RST}${G_Z1_BG}${G_Z2_BG}${G_Z2_FG}${sep}${RST}\
${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} "
;;
*) *)
# aurora (default) # aurora (default)
PS1="\ PS1="\