Skip to content

Instantly share code, notes, and snippets.

@ApolloZhu
Created June 28, 2018 06:13
Show Gist options
  • Save ApolloZhu/97d404c67b2d4d066d5c2859d8e743fb to your computer and use it in GitHub Desktop.
Save ApolloZhu/97d404c67b2d4d066d5c2859d8e743fb to your computer and use it in GitHub Desktop.
Basically PS1
prompt_status() {
local symbols
symbols=()
[[ $RETVAL -ne 0 ]] && symbols+="%{%F{red}%}✘ 🤯 "
[[ $UID -eq 0 ]] && symbols+="%{%F{yellow}%}⚡ 😎 "
[[ $(jobs -l | wc -l) -gt 0 ]] && symbols+="%{%F{cyan}%}⚙ 🤔 "
if [[ -n "$symbols" ]] ; then
prompt_segment black default "$symbols"
else
prompt_segment black default "🧐 "
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment