Skip to content

Instantly share code, notes, and snippets.

@dchapman1988
Created June 6, 2012 11:35
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dchapman1988/2881404 to your computer and use it in GitHub Desktop.
Save dchapman1988/2881404 to your computer and use it in GitHub Desktop.
# This goes in your ~/.bashrc
if [ -f ~/.bash_files/prompts/elite ]; then
. ~/.bash_files/prompts/elite
elite
fi
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
}
get_rvm_prompt() {
~/.rvm/bin/rvm-prompt 2> /dev/null
}
function elite
{
local GRAY="\[\033[1;30m\]"
local LIGHT_GRAY="\[\033[0;37m\]"
local CYAN="\[\033[0;36m\]"
local LIGHT_CYAN="\[\033[1;36m\]"
local NO_COLOUR="\[\033[0m\]"
case $TERM in
xterm*|rxvt*)
local TITLEBAR='\[\033]0;\u@\h:\w\007\]'
;;
*)
local TITLEBAR=""
;;
esac
local temp=$(tty)
local GRAD1=${temp:5}
PS1="$TITLEBAR\
$GRAY-$CYAN-$LIGHT_CYAN(\
$CYAN\u$GRAY@$CYAN\h\
$LIGHT_CYAN)$CYAN-$LIGHT_CYAN(\
$CYAN\#$GRAY/$CYAN$GRAD1\
$LIGHT_CYAN)$CYAN-$LIGHT_CYAN(\
$CYAN\$(date +%H%M)$GRAY/$CYAN\$(date +%d-%b-%y)\
$LIGHT_CYAN)$CYAN-$GRAY-\
$LIGHT_GRAY\n\
$GRAY-$CYAN-$LIGHT_CYAN(\
$CYAN\$$GRAY:$CYAN\w\
$LIGHT_CYAN)\$(parse_git_branch)\$(get_rvm_prompt)$CYAN-$GRAY-$LIGHT_GRAY \n$ "
PS2="$LIGHT_CYAN-$CYAN-$GRAY-$NO_COLOUR "
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment