refactor code and add fallback prompt to zsh

This commit is contained in:
2026-02-13 10:19:45 +01:00
parent 1cdc70eb70
commit 25a4a6076c
19 changed files with 150 additions and 189 deletions

View File

@@ -0,0 +1,8 @@
if (( EUID == 0 )); then
# If root, omit the username and print the hostname in red.
PS1='%1v%B%F\h %(?..%? )%F{blue}%~ # %f%b'
else
# Otherwise, print the username and hostname in green.
PS1='%1v%B%F{green}%n@%m%F{blue} %(?..%F{red}%? %F{blue})%~ $ %f%b'
fi
RPROMPT=$(date '+%H:%m:%S')