Prompt for git in Hawolex
- Add PS1_GIT toggle for Hawolex - Update installers and context
This commit is contained in:
@@ -94,6 +94,7 @@ _ps1_season() {
|
||||
# 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
|
||||
# PS1_GIT=0|1
|
||||
# Also reads config from /etc/ps1-style or ~/.config/ps1/style
|
||||
_ps1_style_config() {
|
||||
local cfg=""
|
||||
@@ -112,6 +113,7 @@ _ps1_style_config() {
|
||||
PS1_STYLE_PACK) export PS1_STYLE_PACK="$v" ;;
|
||||
PS1_CONTEST_LAYOUT) export PS1_CONTEST_LAYOUT="$v" ;;
|
||||
PS1_HOLIDAY) export PS1_HOLIDAY="$v" ;;
|
||||
PS1_GIT) export PS1_GIT="$v" ;;
|
||||
esac
|
||||
done < "$cfg"
|
||||
fi
|
||||
@@ -349,6 +351,7 @@ __PS1_STYLE="aurora"
|
||||
__PS1_STYLE_PACK="standard"
|
||||
__PS1_CONTEST_LAYOUT="day-time-user"
|
||||
__PS1_HOLIDAY="christmas"
|
||||
__PS1_GIT=0
|
||||
|
||||
_ps1_set_prompt() {
|
||||
local RST="\[\e[0m\]"
|
||||
@@ -632,11 +635,15 @@ ${G_Z2_BG}${G_Z2_FG} ${HOST_PART}${PATH_SEP}${G_PATH_FG}${PATH_PART}${G_END_PAD}
|
||||
local H_SEP=""
|
||||
local H_LEFT_FG="\[\e[38;5;54m\]"
|
||||
local H_RIGHT_FG="\[\e[38;5;31m\]"
|
||||
local H_GIT=""
|
||||
if [[ "$__PS1_GIT" == "1" ]]; then
|
||||
H_GIT="$(__git_capsule)"
|
||||
fi
|
||||
PS1="\
|
||||
${PREFIX}${H_FRAME}╭─${RST}\
|
||||
${H_LEFT_FG}${H_LEFT}${RST}${H_Z1_BG}${H_Z1_FG} ${L1} ${RST}${H_Z1_BG}${H_Z2_BG}${H_Z2_FG}${H_SEP}${RST}\
|
||||
${H_Z2_BG}${H_Z2_FG} ${HOST_PART}${PATH_SEP}${H_PATH_FG}${PATH_PART}${END_PAD}${RST}${H_RIGHT_FG}${H_RIGHT}${RST}\
|
||||
\n${H_FRAME}╰── ${RST}${prompt_sym} ${__PS1_SYM} "
|
||||
\n${H_FRAME}╰── ${RST}${prompt_sym} ${__PS1_SYM}${H_GIT} "
|
||||
;;
|
||||
*)
|
||||
# aurora (default)
|
||||
@@ -668,6 +675,7 @@ _ps1_update() {
|
||||
__PS1_CONTEST_LAYOUT="$(_ps1_contest_layout)"
|
||||
__PS1_HOLIDAY="$(_ps1_holiday)"
|
||||
__PS1_STYLE="$(_ps1_style)"
|
||||
__PS1_GIT="${PS1_GIT:-0}"
|
||||
__PS1_SYM="$(_ps1_symbol)"
|
||||
__PS1_PATH="$(_ps1_path)"
|
||||
if _ps1_has_nf; then __PS1_USE_NF=1; else __PS1_USE_NF=0; fi
|
||||
|
||||
Reference in New Issue
Block a user