Skip to content

Instantly share code, notes, and snippets.

@jcromartie
Created September 18, 2013 18:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jcromartie/6613833 to your computer and use it in GitHub Desktop.
Save jcromartie/6613833 to your computer and use it in GitHub Desktop.
Put a thumbs-up or thumbs-down in your prompt based on the exit code of the last command
thumbsDown=$(printf "\xF0\x9F\x91\x8E")
thumbsUp=$(printf "\xF0\x9F\x91\x8D")
function exitIcon()
{
if [ $? -eq 0 ]
then
echo $thumbsUp
else
echo $thumbsDown
fi
}
export PS1='[\[\033[33;1m\]\d \T\[\033[0m\] \[\033[32;1m\]\u@\h \[\033[34m\]\W\[\033[0m\]] $(exitIcon)\n$ '
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment