Created
September 18, 2013 18:57
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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