Unify global installer with shared PS1

- Use dotfiles/ps1/ps1.sh for global installs

- Force NF caps and bold prompt arrow in shared PS1
This commit is contained in:
2026-01-24 08:28:39 +00:00
parent cc94612994
commit 259c1061bb
2 changed files with 16 additions and 140 deletions

View File

@@ -18,6 +18,9 @@ if [[ -f "$HOME/.config/ps1/disable" ]]; then
return 0
fi
# Force NF separators globally (rounded caps) unless ASCII is forced.
export PS1_FORCE_NF=1
# Nerd Font detection (best-effort) + overrides
# PS1_FORCE_ASCII=1 -> always fallback separators
# PS1_FORCE_NF=1 -> always Nerd Font separators
@@ -90,6 +93,8 @@ _ps1_set_prompt() {
# Status colors
local OK="\[\e[38;5;76m\]"
local BAD="\[\e[38;5;203m\]"
local BOLD="\[\e[1m\]"
local NOBOLD="\[\e[22m\]"
local left right sep
if [[ "$__PS1_USE_NF" -eq 1 ]]; then
@@ -100,16 +105,16 @@ _ps1_set_prompt() {
local prompt_sym
if [[ "$__PS1_STATUS" -eq 0 ]]; then
prompt_sym="${OK}${RST}"
prompt_sym="${OK}${BOLD}${NOBOLD}${RST}"
else
prompt_sym="${BAD}${RST}"
prompt_sym="${BAD}${BOLD}${NOBOLD}${RST}"
fi
# Keep order: date time user | host path, newline, then prompt
PS1="\
${FRAME}╭─${RST}\
${Z1_BG}${Z1_FG}${left} \\d \\A \\u ${RST}${Z1_BG}${Z2_BG}${Z2_FG}${sep}${RST}\
${Z2_BG}${Z2_FG} @\\h ${PATH_FG}${__PS1_PATH} ${RST}${Z2_BG}${Z2_FG}${right}${RST}\
${Z2_BG}${Z2_FG} @\\h ${PATH_FG}${__PS1_PATH}${RST}${Z2_BG}${Z2_FG}${right}${RST}\
\n${FRAME}╰── ${RST}${prompt_sym} ${__PS1_SYM} "
}