From d3f6bd8f6dceb332ead08bca417812e1a96cd49b Mon Sep 17 00:00:00 2001 From: steffen Date: Sat, 24 Jan 2026 03:40:05 +0000 Subject: [PATCH] design --- ps1.sh | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/ps1.sh b/ps1.sh index 2120e24..bb0adb8 100644 --- a/ps1.sh +++ b/ps1.sh @@ -39,7 +39,7 @@ _ps1_symbol() { } # ------------------------------------------------- -# Path shortening (keeps /home/user) +# Path shortening (keeps /home/user visible) # ------------------------------------------------- _ps1_path() { local p="$PWD" @@ -75,14 +75,30 @@ __PS1_PREV_PROMPT_COMMAND="${PROMPT_COMMAND-}" ps1_on() { PROMPT_COMMAND="_ps1_update" - local BOX="\[\e[38;5;183m\]" - local VAL="\[\e[38;5;117m\]" - local ACC="\[\e[38;5;229m\]" + # Foreground colors + local BOX_FG="\[\e[38;5;183m\]" + local DATE_FG="\[\e[38;5;229m\]" # date + local TIME_FG="\[\e[38;5;159m\]" # time (different from date) + local USER_FG="\[\e[38;5;81m\]" # user + local HOST_FG="\[\e[38;5;214m\]" # host (different from user) + local PATH_FG="\[\e[38;5;117m\]" # path + + # Background blocks (inspired by your screenshot) + # Use subtle backgrounds + readable foregrounds. + local DATE_BG="\[\e[48;5;236m\]" + local USER_BG="\[\e[48;5;238m\]" + local PATH_BG="\[\e[48;5;236m\]" + + # Status colors local OK="\[\e[38;5;76m\]" local BAD="\[\e[38;5;203m\]" - local RST="\[\e[0m\]" - PS1="${BOX}╭─(${ACC}\d${BOX} ${ACC}\A${BOX})-(${VAL}\u${BOX}@${VAL}\h${BOX})-(${VAL}\${__PS1_PATH}${BOX})${RST}\n${BOX}╰──\$( [ \$__PS1_STATUS -eq 0 ] && printf '${OK}' || printf '${BAD}' )➜ ${RST}\$ \${__PS1_SYM} " + local RST="\[\e[0m\]" + local SP=" " # just for readability + + # Keep exact order: + # date, time, user@host, full/short path, newline, arrow + $ + time-based emoji + PS1="${BOX_FG}╭─(${DATE_BG}${DATE_FG}\d${RST}${BOX_FG}${SP}${DATE_BG}${TIME_FG}\A${RST}${BOX_FG})-(${USER_BG}${USER_FG}\u${RST}${BOX_FG}@${USER_BG}${HOST_FG}\h${RST}${BOX_FG})-(${PATH_BG}${PATH_FG}\${__PS1_PATH}${RST}${BOX_FG})${RST}\n${BOX_FG}╰──\$( [ \$__PS1_STATUS -eq 0 ] && printf '${OK}' || printf '${BAD}' )➜ ${RST}\$ \${__PS1_SYM} " } ps1_off() {