From 60163a5350a047366c517db8b2ab58d1804768b4 Mon Sep 17 00:00:00 2001 From: Ben Brunton Date: Tue, 11 Nov 2014 21:11:23 +0000 Subject: [PATCH 1/3] inclued brunton theme --- themes/brunton/brunton.theme.bash | 34 ++++++++++++++++++++++++++ themes/brunton/brunton.theme.bash~ | 38 ++++++++++++++++++++++++++++++ 2 files changed, 72 insertions(+) create mode 100644 themes/brunton/brunton.theme.bash create mode 100644 themes/brunton/brunton.theme.bash~ diff --git a/themes/brunton/brunton.theme.bash b/themes/brunton/brunton.theme.bash new file mode 100644 index 00000000..839ae674 --- /dev/null +++ b/themes/brunton/brunton.theme.bash @@ -0,0 +1,34 @@ +SCM_THEME_PROMPT_PREFIX="" +SCM_THEME_PROMPT_SUFFIX="" + +SCM_THEME_PROMPT_DIRTY=" ${bold_red}✗${normal}" +SCM_THEME_PROMPT_CLEAN=" ${bold_green}✓${normal}" +SCM_GIT_CHAR="${bold_green}±${normal}" +SCM_SVN_CHAR="${bold_cyan}⑆${normal}" +SCM_HG_CHAR="${bold_red}☿${normal}" + +is_vim_shell() { + if [ ! -z "$VIMRUNTIME" ] + then + echo "[${cyan}vim shell${normal}]" + fi +} + +scm_prompt() { + CHAR=$(scm_char) + if [ $CHAR = $SCM_NONE_CHAR ] + then + return + else + echo " $(scm_char) (${white}$(scm_prompt_info)${normal})" + fi +} + +prompt() { + PS1="${white}${background_blue} \u${normal}${background_blue}@${red}${background_blue}\h ${blue}${background_white} \t ${reset_color}${normal} $(battery_charge) +${bold_black}${background_white} \w ${normal}$(scm_prompt)$(is_vim_shell) +${white}>${normal} " + +} + +PROMPT_COMMAND=prompt diff --git a/themes/brunton/brunton.theme.bash~ b/themes/brunton/brunton.theme.bash~ new file mode 100644 index 00000000..89bd435d --- /dev/null +++ b/themes/brunton/brunton.theme.bash~ @@ -0,0 +1,38 @@ +SCM_THEME_PROMPT_PREFIX="" +SCM_THEME_PROMPT_SUFFIX="" + +SCM_THEME_PROMPT_DIRTY=" ${bold_red}✗${normal}" +SCM_THEME_PROMPT_CLEAN=" ${bold_green}✓${normal}" +SCM_GIT_CHAR="${bold_green}±${normal}" +SCM_SVN_CHAR="${bold_cyan}⑆${normal}" +SCM_HG_CHAR="${bold_red}☿${normal}" + +is_vim_shell() { + if [ ! -z "$VIMRUNTIME" ] + then + echo "[${cyan}vim shell${normal}]" + fi +} + +scm_prompt() { + CHAR=$(scm_char) + if [ $CHAR = $SCM_NONE_CHAR ] + then + return + else + echo " $(scm_char) (${white}$(scm_prompt_info)${normal})" + fi +} + +prompt() { + PS1="${white}${background_blue} \u${normal}${background_blue}@${red}${background_blue}\h ${blue}${background_white} \t ${reset_color}${normal} $(battery_charge) +${bold_black}${background_white} \w ${normal}$(scm_prompt)$(is_vim_shell) +${white}>${normal} " + +} + + + + + +PROMPT_COMMAND=prompt From ba891f9d12fbbd4af893b0109f6c164fab14eaf8 Mon Sep 17 00:00:00 2001 From: Ben Brunton Date: Tue, 11 Nov 2014 21:13:14 +0000 Subject: [PATCH 2/3] Delete brunton.theme.bash~ --- themes/brunton/brunton.theme.bash~ | 38 ------------------------------ 1 file changed, 38 deletions(-) delete mode 100644 themes/brunton/brunton.theme.bash~ diff --git a/themes/brunton/brunton.theme.bash~ b/themes/brunton/brunton.theme.bash~ deleted file mode 100644 index 89bd435d..00000000 --- a/themes/brunton/brunton.theme.bash~ +++ /dev/null @@ -1,38 +0,0 @@ -SCM_THEME_PROMPT_PREFIX="" -SCM_THEME_PROMPT_SUFFIX="" - -SCM_THEME_PROMPT_DIRTY=" ${bold_red}✗${normal}" -SCM_THEME_PROMPT_CLEAN=" ${bold_green}✓${normal}" -SCM_GIT_CHAR="${bold_green}±${normal}" -SCM_SVN_CHAR="${bold_cyan}⑆${normal}" -SCM_HG_CHAR="${bold_red}☿${normal}" - -is_vim_shell() { - if [ ! -z "$VIMRUNTIME" ] - then - echo "[${cyan}vim shell${normal}]" - fi -} - -scm_prompt() { - CHAR=$(scm_char) - if [ $CHAR = $SCM_NONE_CHAR ] - then - return - else - echo " $(scm_char) (${white}$(scm_prompt_info)${normal})" - fi -} - -prompt() { - PS1="${white}${background_blue} \u${normal}${background_blue}@${red}${background_blue}\h ${blue}${background_white} \t ${reset_color}${normal} $(battery_charge) -${bold_black}${background_white} \w ${normal}$(scm_prompt)$(is_vim_shell) -${white}>${normal} " - -} - - - - - -PROMPT_COMMAND=prompt From 18b77e2fec7d5e4166e6b530362ee32db48a0ab9 Mon Sep 17 00:00:00 2001 From: Ben Brunton Date: Wed, 12 Nov 2014 10:00:45 +0000 Subject: [PATCH 3/3] included safe battery charge to prevent error when battery plugin not enabled --- themes/brunton/brunton.theme.bash | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/themes/brunton/brunton.theme.bash b/themes/brunton/brunton.theme.bash index 839ae674..7c84faec 100644 --- a/themes/brunton/brunton.theme.bash +++ b/themes/brunton/brunton.theme.bash @@ -24,8 +24,15 @@ scm_prompt() { fi } +safe_battery_charge() { + if [ -e "${BASH_IT}/plugins/enabled/battery.plugin.bash" ]; + then + battery_charge + fi +} + prompt() { - PS1="${white}${background_blue} \u${normal}${background_blue}@${red}${background_blue}\h ${blue}${background_white} \t ${reset_color}${normal} $(battery_charge) + PS1="${white}${background_blue} \u${normal}${background_blue}@${red}${background_blue}\h ${blue}${background_white} \t ${reset_color}${normal} $(safe_battery_charge) ${bold_black}${background_white} \w ${normal}$(scm_prompt)$(is_vim_shell) ${white}>${normal} "