Update git emojis and move Hawolex to contest
- Add git state emojis and branch wrapping - Move Hawolex to contest styles and update JSONs
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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="\
|
||||
|
||||
Reference in New Issue
Block a user