While working in Ubuntu, I feel my bash terminal as my home. Afterall, I spend a big part of my time there, so I need it to be nicely enjoyable.
Here’s my .bashrc with my own configurations. It is a collection of configurations that I’ve found over the interwebz, and the lastest version can be found in my Gist .
It’s a tweaked version of the .bashrc found here .
I added the cowsay with the a fortune as well, so every time I open a new terminal I get a nice quote. Awesome.
How cool is the cow?
#### GIT && PS1
# SETUP CONSTANTS
# Bunch-o-predefined colors. Makes reading code easier than escape sequences.
# Reset
Color_Off = " \[\0 33[0m \] " # Text Reset
# Regular Colors
Black = " \[\0 33[0;30m \] " # Black
Red = " \[\0 33[0;31m \] " # Red
Green = " \[\0 33[0;32m \] " # Green
Yellow = " \[\0 33[0;33m \] " # Yellow
Blue = " \[\0 33[0;34m \] " # Blue
Purple = " \[\0 33[0;35m \] " # Purple
Cyan = " \[\0 33[0;36m \] " # Cyan
White = " \[\0 33[0;37m \] " # White
# Bold
BBlack = " \[\0 33[1;30m \] " # Black
BRed = " \[\0 33[1;31m \] " # Red
BGreen = " \[\0 33[1;32m \] " # Green
BYellow = " \[\0 33[1;33m \] " # Yellow
BBlue = " \[\0 33[1;34m \] " # Blue
BPurple = " \[\0 33[1;35m \] " # Purple
BCyan = " \[\0 33[1;36m \] " # Cyan
BWhite = " \[\0 33[1;37m \] " # White
# Underline
UBlack = " \[\0 33[4;30m \] " # Black
URed = " \[\0 33[4;31m \] " # Red
UGreen = " \[\0 33[4;32m \] " # Green
UYellow = " \[\0 33[4;33m \] " # Yellow
UBlue = " \[\0 33[4;34m \] " # Blue
UPurple = " \[\0 33[4;35m \] " # Purple
UCyan = " \[\0 33[4;36m \] " # Cyan
UWhite = " \[\0 33[4;37m \] " # White
# Background
On_Black = " \[\0 33[40m \] " # Black
On_Red = " \[\0 33[41m \] " # Red
On_Green = " \[\0 33[42m \] " # Green
On_Yellow = " \[\0 33[43m \] " # Yellow
On_Blue = " \[\0 33[44m \] " # Blue
On_Purple = " \[\0 33[45m \] " # Purple
On_Cyan = " \[\0 33[46m \] " # Cyan
On_White = " \[\0 33[47m \] " # White
# High Intensty
IBlack = " \[\0 33[0;90m \] " # Black
IRed = " \[\0 33[0;91m \] " # Red
IGreen = " \[\0 33[0;92m \] " # Green
IYellow = " \[\0 33[0;93m \] " # Yellow
IBlue = " \[\0 33[0;94m \] " # Blue
IPurple = " \[\0 33[0;95m \] " # Purple
ICyan = " \[\0 33[0;96m \] " # Cyan
IWhite = " \[\0 33[0;97m \] " # White
# Bold High Intensty
BIBlack = " \[\0 33[1;90m \] " # Black
BIRed = " \[\0 33[1;91m \] " # Red
BIGreen = " \[\0 33[1;92m \] " # Green
BIYellow = " \[\0 33[1;93m \] " # Yellow
BIBlue = " \[\0 33[1;94m \] " # Blue
BIPurple = " \[\0 33[1;95m \] " # Purple
BICyan = " \[\0 33[1;96m \] " # Cyan
BIWhite = " \[\0 33[1;97m \] " # White
# High Intensty backgrounds
On_IBlack = " \[\0 33[0;100m \] " # Black
On_IRed = " \[\0 33[0;101m \] " # Red
On_IGreen = " \[\0 33[0;102m \] " # Green
On_IYellow = " \[\0 33[0;103m \] " # Yellow
On_IBlue = " \[\0 33[0;104m \] " # Blue
On_IPurple = " \[\0 33[10;95m \] " # Purple
On_ICyan = " \[\0 33[0;106m \] " # Cyan
On_IWhite = " \[\0 33[0;107m \] " # White
# Various variables you might want for your PS1 prompt instead
Time12h = " \T "
Time12a = " \@ "
PathShort = " \w "
PathFull = " \W "
NewLine = " \n "
Jobs = " \j "
# cow saying your fortune (how awesome is that?)
fortune -s | cowsay
#show current project and branch
GIT_PS1_SHOWDIRTYSTATE = false
if [[ ${ EUID } == 0 ]] ; then
sq_color = $BRed
else
sq_color = $BBlue
fi
export PS1 = " \n $sq_color \3 42 \2 24 \2 14 \3 42 \2 24 \2 00 \$ ([[ \$ ? != 0 ]] && echo \" [ $BRed \3 42 \2 34 \2 27 $sq_color ] \3 42 \2 24 \2 00 \" )[ $IBlack \t $sq_color ] \3 42 \2 24 \2 00[ \[\0 33[01;37m \]\u $sq_color ] \3 42 \2 24 \2 00[ $BGreen \w $sq_color ] \n $sq_color \3 42 \2 24 \2 24 \3 42 \2 24 \2 00 \3 42 \2 24 \2 00> $BRed \$ (" __git_ps1") $sq_color \$ $Color_Off "
unset sq_color
In order to work properly, it requires git, fortune and cowsay installed.
It’s easy to notice that most of the colors definition are not used at all, but I like to keep all color definitions, so I’m able to change anything whenever I feel like.