Skip to content

Instantly share code, notes, and snippets.

@hub23
Last active December 1, 2019 16:44
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save hub23/c226b1c77446e099f7684b0d21c6b22a to your computer and use it in GitHub Desktop.
Save hub23/c226b1c77446e099f7684b0d21c6b22a to your computer and use it in GitHub Desktop.
Custom ZSH Theme
# user colors
if [ $UID -eq 0 ]; then USERCOLOR="red"; else USERCOLOR="green"; fi
# box name
function box_name {
[ -f ~/.box-name ] && cat ~/.box-name || echo $HOST
}
# workdir
local current_dir='${PWD/#$HOME/~}'
# return status
local ret_status="%(?:%{$fg_bold[255]%}➤ :%{$fg_bold[red]%}➤ %s)"
# prompt format: \n USER MACHINE DIRECTORY \n STATUS
PROMPT="%{$fg[$USERCOLOR]%}%n\
%{$reset_color%}\
%{$fg[255]%} \
$(box_name)\
%{$reset_color%} \
%{$reset_color%}\
${current_dir}\
%{$reset_color%}
${ret_status}\
%{$reset_color%}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment