design
This commit is contained in:
28
ps1.sh
28
ps1.sh
@@ -39,7 +39,7 @@ _ps1_symbol() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
# -------------------------------------------------
|
# -------------------------------------------------
|
||||||
# Path shortening (keeps /home/user)
|
# Path shortening (keeps /home/user visible)
|
||||||
# -------------------------------------------------
|
# -------------------------------------------------
|
||||||
_ps1_path() {
|
_ps1_path() {
|
||||||
local p="$PWD"
|
local p="$PWD"
|
||||||
@@ -75,14 +75,30 @@ __PS1_PREV_PROMPT_COMMAND="${PROMPT_COMMAND-}"
|
|||||||
ps1_on() {
|
ps1_on() {
|
||||||
PROMPT_COMMAND="_ps1_update"
|
PROMPT_COMMAND="_ps1_update"
|
||||||
|
|
||||||
local BOX="\[\e[38;5;183m\]"
|
# Foreground colors
|
||||||
local VAL="\[\e[38;5;117m\]"
|
local BOX_FG="\[\e[38;5;183m\]"
|
||||||
local ACC="\[\e[38;5;229m\]"
|
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 OK="\[\e[38;5;76m\]"
|
||||||
local BAD="\[\e[38;5;203m\]"
|
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() {
|
ps1_off() {
|
||||||
|
|||||||
Reference in New Issue
Block a user