Skip to content

Instantly share code, notes, and snippets.

@neocotic
Last active August 3, 2017 08:43
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 neocotic/5d7f50d33a387821735f to your computer and use it in GitHub Desktop.
Save neocotic/5d7f50d33a387821735f to your computer and use it in GitHub Desktop.
Personal Bash Prompt
# Override bash prompt depending on colors being enabled and if you are root
if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
if [ $(id -u) -eq 0 ]; then
PS1=$'\u@\h:\W\[$(tput setaf 2)\]$(__git_ps1 " (%s)")\[$(tput sgr0)\] \[$(tput setaf 1)\]\xCE\xBB\[$(tput sgr0)\] '
else
PS1=$'\u@\h:\W\[$(tput setaf 2)\]$(__git_ps1 " (%s)")\[$(tput sgr0)\] \xCE\xBB '
fi
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment