Files
dotconfs/.config/zsh/server-prompt.zsh
T

35 lines
1.4 KiB
Bash

# Prompt for the server role: oh-my-zsh's ys layout in gruvbox colours.
#
# Replaces powerlevel10k on shron. Two lines, plain ASCII, readable from any
# terminal. Fixed 256-colour indices approximating gruvbox, because terminal
# themes remap the 16 named colours freely - under gruvbox "white" on "blue"
# was barely legible.
#
# user@host is what has to stand out: plain red for templis, a red block for
# root. The same file is installed root-owned for root's shell (never sourced
# from this home directory, which would let templis run code as root).
#
# Needs oh-my-zsh loaded first (git_prompt_info) and no other theme active.
# gruvbox (256-colour): red 167, yellow 214, green 142, aqua 108, blue 109,
# grey 245, dark background 235
ZSH_THEME_GIT_PROMPT_PREFIX=" %F{245}on%f git:%F{108}"
ZSH_THEME_GIT_PROMPT_SUFFIX="%f"
ZSH_THEME_GIT_PROMPT_DIRTY=" %F{167}x"
ZSH_THEME_GIT_PROMPT_CLEAN=" %F{142}o"
setopt PROMPT_SUBST
# Assembled piece by piece: inside single quotes a trailing backslash does not
# join lines, and single quotes are needed so $(git_prompt_info) runs per prompt.
PROMPT=$'\n'
PROMPT+='%B%(#,%F{167},%F{109})#%f%b '
PROMPT+='%(#,%K{167}%F{235}%B %n@%m %b%f%k,%B%F{167}%n@%m%f%b) '
PROMPT+='%F{245}in%f '
PROMPT+='%B%F{214}%~%f%b'
PROMPT+='$(git_prompt_info) '
PROMPT+='%F{245}[%*]%f%(?,, C:%F{167}%?%f)'
PROMPT+=$'\n'
PROMPT+='%B%F{167}%(#,#,$)%f%b '
RPROMPT=''