# ~/.bashrc: executed by bash(1) for non-login shells. # For some unknown reason bash refuses to inherit # PS1 in some circumstances that I can't figure out. # Putting PS1 here ensures that it gets loaded every time. # The following sets up the console prompt # the foreground colors BLK="\[\033[0;30m\]" ; BLK1="\[\033[1;30m\]" #dark grey RED="\[\033[0;31m\]" ; RED1="\[\033[1;31m\]" GRN="\[\033[0;32m\]" ; GRN1="\[\033[1;32m\]" YEL="\[\033[0;33m\]" ; YEL1="\[\033[1;33m\]" BLU="\[\033[0;34m\]" ; BLU1="\[\033[1;34m\]" PUR="\[\033[0;35m\]" ; PUR1="\[\033[1;35m\]" AQA="\[\033[0;36m\]" ; AQA1="\[\033[1;36m\]" GRY="\[\033[0;37m\]" ; GRY1="\[\033[1;37m\]" #white WHT="\[\033[0;38m\]" ; WHT1="\[\033[1;38m\]" #white # the background colors BBLK="\[\033[0;40m\]" ; BBLK1="\[\033[1;40m\]" #dark grey BRED="\[\033[0;41m\]" ; BRED1="\[\033[1;41m\]" BGRN="\[\033[0;42m\]" ; BGRN1="\[\033[1;42m\]" BYEL="\[\033[0;43m\]" ; BYEL1="\[\033[1;43m\]" BBLU="\[\033[0;44m\]" ; BBLU1="\[\033[1;44m\]" BPUR="\[\033[0;45m\]" ; BPUR1="\[\033[1;45m\]" BAQA="\[\033[0;45m\]" ; BAQA1="\[\033[1;46m\]" BGRY="\[\033[0;45m\]" ; BGRY1="\[\033[1;47m\]" #white BWHT="\[\033[0;45m\]" ; BWHT1="\[\033[1;48m\]" #white # color termination token NOCOLOR="\[\033[0m\]" HOSTCOL=`python -c " import commands, md5 colorTuples = zip( [0]*8 + [1]*8, range(30,39)*2 ) hostname = commands.getoutput( 'hostname' ) index = int( md5.md5(hostname).hexdigest(), 16 ) % len(colorTuples) hostColor = r'%d;%dm' % colorTuples[index] print hostColor "` HOSTCOL="\[\033[$HOSTCOL\]" BAR=$GRY"____" COL=$YEL PS1="\n$BAR$COL[$GRY\u$COL@$HOSTCOL\h$COL] [$GRY\w$COL]$BAR$NOCOLOR\n \$ " export PS1 alias dir="ls -lh --color=auto" alias dri="dir" alias idr="dir"