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:
@@ -149,12 +149,15 @@ if [[ -t 0 ]]; then
|
||||
echo " Preview: [user time] - @host /path"
|
||||
echo " 5) Mono - Clean monochrome, fast read"
|
||||
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
|
||||
case "${style_pick}" in
|
||||
2) style_choice="neon" ;;
|
||||
3) style_choice="forge" ;;
|
||||
4) style_choice="circuit" ;;
|
||||
5) style_choice="mono" ;;
|
||||
6) style_choice="git" ;;
|
||||
""|1) style_choice="aurora" ;;
|
||||
*) echo "Invalid choice, using aurora."; style_choice="aurora" ;;
|
||||
esac
|
||||
|
||||
@@ -125,12 +125,15 @@ if [[ -t 0 ]]; then
|
||||
echo " Preview: [user time] - @host /path"
|
||||
echo " 5) Mono - Clean monochrome, fast read"
|
||||
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
|
||||
case "${style_pick}" in
|
||||
2) style_choice="neon" ;;
|
||||
3) style_choice="forge" ;;
|
||||
4) style_choice="circuit" ;;
|
||||
5) style_choice="mono" ;;
|
||||
6) style_choice="git" ;;
|
||||
""|1) style_choice="aurora" ;;
|
||||
*) echo "Invalid choice, using aurora."; style_choice="aurora" ;;
|
||||
esac
|
||||
|
||||
@@ -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="\
|
||||
|
||||
Reference in New Issue
Block a user