diff --git a/themes/base.theme.bash b/themes/base.theme.bash index 58efe11d..53091217 100644 --- a/themes/base.theme.bash +++ b/themes/base.theme.bash @@ -109,6 +109,20 @@ function hg_prompt_vars { SCM_CHANGE=$(hg summary 2> /dev/null | grep parent | awk '{print $2}') } +function hg_prompt_info() { + if [[ -n $(hg status 2> /dev/null) ]]; then + state=${HG_THEME_PROMPT_DIRTY:-$SCM_THEME_PROMPT_DIRTY} + else + state=${HG_THEME_PROMPT_CLEAN:-$SCM_THEME_PROMPT_CLEAN} + fi + prefix=${HG_THEME_PROMPT_PREFIX:-$SCM_THEME_PROMPT_PREFIX} + suffix=${HG_THEME_PROMPT_SUFFIX:-$SCM_THEME_PROMPT_SUFFIX} + branch=$(hg summary 2> /dev/null | grep branch | awk '{print $2}') + changeset=$(hg summary 2> /dev/null | grep parent | awk '{print $2}') + + echo -e "$prefix$branch:${changeset#*:}$state$suffix" +} + function rvm_version_prompt { if which rvm &> /dev/null; then rvm=$(rvm tools identifier) || return diff --git a/themes/colors.theme.bash b/themes/colors.theme.bash index ff8776d2..6e15f343 100644 --- a/themes/colors.theme.bash +++ b/themes/colors.theme.bash @@ -1,44 +1,44 @@ #!/bin/bash -black="\[\e[0;30m\]" -red="\[\e[0;31m\]" -green="\[\e[0;32m\]" -yellow="\[\e[0;33m\]" -blue="\[\e[0;34m\]" -purple="\[\e[0;35m\]" -cyan="\[\e[0;36m\]" -white="\[\e[1;37m\]" -orange="\[\e[33;40m\]" +black='\[\e[0;30m\]' +red='\[\e[0;31m\]' +green='\[\e[0;32m\]' +yellow='\[\e[0;33m\]' +blue='\[\e[0;34m\]' +purple='\[\e[0;35m\]' +cyan='\[\e[0;36m\]' +white='\[\e[1;37m\]' +orange='\[\e[33;40m\]' -bold_black="\[\e[1;30m\]" -bold_red="\[\e[1;31m\]" -bold_green="\[\e[1;32m\]" -bold_yellow="\[\e[1;33m\]" -bold_blue="\[\e[1;34m\]" -bold_purple="\[\e[1;35m\]" -bold_cyan="\[\e[1;36m\]" -bold_white="\[\e[1;37m\]" -bold_orange="\[\e[1;33;40m\]" +bold_black='\[\e[1;30m\]' +bold_red='\[\e[1;31m\]' +bold_green='\[\e[1;32m\]' +bold_yellow='\[\e[1;33m\]' +bold_blue='\[\e[1;34m\]' +bold_purple='\[\e[1;35m\]' +bold_cyan='\[\e[1;36m\]' +bold_white='\[\e[1;37m\]' +bold_orange='\[\e[1;33;40m\]' -underline_black="\[\e[4;30m\]" -underline_red="\[\e[4;31m\]" -underline_green="\[\e[4;32m\]" -underline_yellow="\[\e[4;33m\]" -underline_blue="\[\e[4;34m\]" -underline_purple="\[\e[4;35m\]" -underline_cyan="\[\e[4;36m\]" -underline_white="\[\e[4;37m\]" -underline_orange="\[\e[4;33;40m\]" +underline_black='\[\e[4;30m\]' +underline_red='\[\e[4;31m\]' +underline_green='\[\e[4;32m\]' +underline_yellow='\[\e[4;33m\]' +underline_blue='\[\e[4;34m\]' +underline_purple='\[\e[4;35m\]' +underline_cyan='\[\e[4;36m\]' +underline_white='\[\e[4;37m\]' +underline_orange='\[\e[4;33;40m\]' -background_black="\[\e[40m\]" -background_red="\[\e[41m\]" -background_green="\[\e[42m\]" -background_yellow="\[\e[43m\]" -background_blue="\[\e[44m\]" -background_purple="\[\e[45m\]" -background_cyan="\[\e[46m\]" -background_white="\[\e[47m\]" +background_black='\[\e[40m\]' +background_red='\[\e[41m\]' +background_green='\[\e[42m\]' +background_yellow='\[\e[43m\]' +background_blue='\[\e[44m\]' +background_purple='\[\e[45m\]' +background_cyan='\[\e[46m\]' +background_white='\[\e[47m\]' -normal="\[\e[00m\]" -reset_color="\[\e[39m\]" +normal='\[\e[00m\]' +reset_color='\[\e[39m\]' diff --git a/themes/modern/modern.theme.bash b/themes/modern/modern.theme.bash index 32c7cabb..fff80350 100644 --- a/themes/modern/modern.theme.bash +++ b/themes/modern/modern.theme.bash @@ -41,7 +41,7 @@ prompt() { # Yes, the indenting on these is weird, but it has to be like # this otherwise it won't display properly. - PS1="${TITLEBAR}${bold_red}┌─${reset_color}$(modern_scm_prompt)[${cyan}\W${normal}][$(battery_charge)]$(is_vim_shell) + PS1="${bold_red}┌─${reset_color}$(scm_prompt)[${cyan}\W${normal}]$(is_vim_shell) ${bold_red}└─▪${normal} " else PS1="${TITLEBAR}┌─$(modern_scm_prompt)[${cyan}\W${normal}][$(battery_charge)]$(is_vim_shell) diff --git a/themes/simple/simple.theme.bash b/themes/simple/simple.theme.bash index 2dcd7e7c..5bc4d626 100644 --- a/themes/simple/simple.theme.bash +++ b/themes/simple/simple.theme.bash @@ -11,11 +11,8 @@ case $TERM in TITLEBAR="" ;; esac -PROMPT="${TITLEBAR}${orange}${reset_color}${green}\w${bold_blue}\[\$(scm_prompt_info)\]${reset_color} " +PROMPT="${TITLEBAR}${bold_green}\w${reset_color}${bold_blue}\$(scm_prompt_info)${reset_color} " - -# scm themeing -SCM_THEME_PROMPT_DIRTY=" ✗" -SCM_THEME_PROMPT_CLEAN=" ✓" +# scm theming SCM_THEME_PROMPT_PREFIX="(" SCM_THEME_PROMPT_SUFFIX=")"