Skip to content

Instantly share code, notes, and snippets.

@yocchi
Created April 23, 2013 14:26
Show Gist options
  • Save yocchi/5444001 to your computer and use it in GitHub Desktop.
Save yocchi/5444001 to your computer and use it in GitHub Desktop.
COLOR_OFF="\[\033[00m\]"
BLACK="\[\033[1;30m\]"
RED="\[\033[1;31m\]"
GREEN="\[\033[1;32m\]"
YELLOW="\[\033[1;33m\]"
BLUE="\[\033[1;34m\]"
MAGENTA="\[\033[1;35m\]"
CYAN="\[\033[1;36m\]"
WHITE="\[\033[1;37m\]"
HOST_COLOR=$RED
if [ $HOSTNAME = 'burst' ]; then
HOST_COLOR=$CYAN
fi
if [ $HOSTNAME = 'grey2' ]; then
HOST_COLOR=$MAGENTA
fi
if [ $HOSTNAME = 'alanreed' ]; then
HOST_COLOR=$YELLOW
fi
PS1="$GREEN\u$RED@$HOST_COLOR\h$RED:$BLUE\w\$([[ \$? != 0 ]] && echo \"$RED:($BLUE\")\$$COLOR_OFF "
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment