Skip to content

Instantly share code, notes, and snippets.

@OrangeTide
Created January 27, 2021 18:52
Show Gist options
  • Save OrangeTide/d719599e9b04a73d5080053c9e754c63 to your computer and use it in GitHub Desktop.
Save OrangeTide/d719599e9b04a73d5080053c9e754c63 to your computer and use it in GitHub Desktop.
Add a cool 😎 prompt to your shell (for bash)
# Add this snippet to your .bashrc instead of your normal prompt (PS1) setting.
# Customize the line below further with your favorite smilies
# 😎 πŸ™‚ 😊 😒 πŸ™ πŸ™ƒ
PS1='$(test $? -eq 0 && echo "\[\033[0;32m\]😎" || echo "\[\033[0;1;31m\]😒")\[\033[0m\] \W\$ '
# Set window title
case "$TERM" in
xterm*)
# see also man xterm(1) - "Window and Icon Titles"
PS1='\[\033]2;\W\a\]'$PS1
;;
screen*)
# see also man screen(1) - "TITLES (naming windows)"
PS1='\[\033k\W\033\\\]'$PS1
;;
esac
## Fin! ##
@OrangeTide
Copy link
Author

This the most important tool in DevOps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment