Created
April 26, 2011 16:12
-
-
Save yrgoldteeth/942562 to your computer and use it in GitHub Desktop.
bash prompt
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
parse_git_branch() { | |
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/' | |
} | |
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)$CYAN-$GRAY-$LIGHT_GRAY " | |
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