Skip to content

Instantly share code, notes, and snippets.

@nevergone
Created May 6, 2011 08:25
Show Gist options
  • Save nevergone/958608 to your computer and use it in GitHub Desktop.
Save nevergone/958608 to your computer and use it in GitHub Desktop.
Linux promt-om
export GIT_PS1_SHOWDIRTYSTATE=true
# colored prompt
USER=`whoami`
if [ $LOGNAME = $USER ] ; then
USERCOLOR=32 # green
else
USERCOLOR=33 # yellow
fi
if [ $USER = 'root' ] ; then
USERCOLOR=31 # red
fi
export PS1='\[\033[$USERCOLOR;1m\]\u\[\033[37;1m\]@\[\033[36;1m\]\h\[\033[35;1m\]-\t-\[\033[37;1m\]\w\[\033[37;0m\]\[\033[31m\]$(__git_ps1)\[\033[00m\]\$ '
export PS2='\033[31;1m-\033[33;1m>\033[37;0m '
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment