Robert R Evans | 9c7cd9a | 2010-10-02 11:55:34 -0700 | [diff] [blame] | 1 | # Some Colors |
| 2 | BGREEN='\[\033[1;32m\]' |
| 3 | GREEN='\[\033[0;32m\]' |
| 4 | BRED='\[\033[1;31m\]' |
| 5 | RED='\[\033[0;31m\]' |
| 6 | BBLUE='\[\033[1;34m\]' |
| 7 | BLUE='\[\033[0;34m\]' |
| 8 | PINK='\[\e[37;1;35m\]' |
| 9 | NORMAL='\[\033[00m\]' |
| 10 | |
| 11 | WHITE='\[\033[1;37m\]' |
| 12 | BLACK='\[\033[0;30m\]' |
| 13 | LIGHT_BLUE='\[\033[1;34m\]' |
| 14 | LIGHT_GREEN='\[\033[1;32m\]' |
| 15 | LIGHT_CYAN='\[\033[1;36m\]' |
| 16 | LIGHT_RED='\[\033[1;31m\]' |
| 17 | LIGHT_PURPLE='\[\033[1;35m\]' |
| 18 | LIGHT_YELLOW='\[\033[1;33m\]' |
| 19 | LIGHT_GRAY='\[\033[0;37m\]' |
| 20 | YELLOW='\[\033[0;33m\]' |
| 21 | PURPLE='\[\033[0;35m\]' |
| 22 | CYAN='\[\033[0;36m\]' |
| 23 | GRAY='\[\033[1;30m\]' |
| 24 | |
| 25 | D=$'\e[37;40m' |
| 26 | PINK=$'\e[35;40m' |
| 27 | GREEN=$'\e[32;40m' |
| 28 | ORANGE=$'\e[33;40m' |
| 29 | |
| 30 | function prompt_char { |
| 31 | git branch >/dev/null 2>/dev/null && echo '±' && return |
| 32 | hg root >/dev/null 2>/dev/null && echo '☿' && return |
| 33 | echo '○' |
| 34 | } |
| 35 | |
| 36 | function parse_git_dirty { |
| 37 | [[ $(git status 2> /dev/null | tail -n1) != "nothing to commit (working directory clean)" ]] && echo "*" |
| 38 | } |
| 39 | |
| 40 | function parse_git_branch { |
| 41 | git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e "s/* \(.*\)/[\1$(parse_git_dirty)]/" |
| 42 | } |