ivabus-zsh-theme/ivabus.zsh-theme

21 lines
564 B
Plaintext
Raw Normal View History

2022-06-06 13:25:34 +03:00
# ivabus zsh prompt theme
__zsh_prompt() {
2022-09-29 18:54:50 +03:00
# set basic prompt with "USERNAME@HOSTNAME "
if [[ $UID == 0 || $EUID == 0 ]]; then
PROMPT="%F{red}%n%f@%F{red}%m "
2022-09-29 18:54:50 +03:00
else
PROMPT="%F{green}%n%f@%F{cyan}%m "
2022-09-29 18:54:50 +03:00
fi
# add to current prompt arrow or [exitcode] if non 0
PROMPT+='%(?:%f➜ :%B%F{red}%(?..[%?]) )%b'
2022-09-29 18:54:50 +03:00
# add current working directory
PROMPT+='%B%F{blue}%(5~|%-1~/…/%3~|%4~)%f%b '
2022-09-29 18:54:50 +03:00
# add $ or #
if [[ $UID == 0 || $EUID == 0 ]]; then
PROMPT+='%F{red}# %f'
2022-09-29 18:54:50 +03:00
else
PROMPT+='%F{white}$ %f'
2022-09-29 18:54:50 +03:00
fi
unset -f __zsh_prompt
2022-06-06 13:25:34 +03:00
}
__zsh_prompt