From 18b77e2fec7d5e4166e6b530362ee32db48a0ab9 Mon Sep 17 00:00:00 2001 From: Ben Brunton Date: Wed, 12 Nov 2014 10:00:45 +0000 Subject: [PATCH] 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} "