Created
May 6, 2011 08:25
-
-
Save nevergone/958608 to your computer and use it in GitHub Desktop.
Linux promt-om
This file contains 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
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