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

@@ -89,8 +89,8 @@ _ps1_season() {
fi
}
# Style selection (aurora/neon/forge/circuit/mono)
# PS1_STYLE=aurora|neon|forge|circuit|mono
# Style selection (aurora/neon/forge/circuit/mono/git)
# 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
@@ -141,6 +141,26 @@ _ps1_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)
_ps1_pick_icon() {
local list_name="$1"
@@ -362,12 +382,12 @@ _ps1_set_prompt() {
FRAME="\[\e[38;5;19m\]"
;;
hawolex)
Z1_BG="\[\e[48;5;61m\]"
Z1_BG="\[\e[48;5;54m\]"
Z1_FG="\[\e[38;5;255m\]"
Z2_BG="\[\e[48;5;37m\]"
Z2_BG="\[\e[48;5;31m\]"
Z2_FG="\[\e[38;5;255m\]"
PATH_FG="\[\e[38;5;194m\]"
FRAME="\[\e[38;5;60m\]"
PATH_FG="\[\e[38;5;230m\]"
FRAME="\[\e[38;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}\
\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)
PS1="\