Merge pull request #367 from benbrunton/master
Ensure that battery_charge function is safe to use in themespull/368/head
commit
e60a9f73c7
|
|
@ -216,3 +216,12 @@ function scm_char {
|
|||
function prompt_char {
|
||||
scm_char
|
||||
}
|
||||
|
||||
if [ ! -e $BASH_IT/plugins/enabled/battery.plugin.bash ]; then
|
||||
# if user has installed battery plugin, skip this...
|
||||
function battery_charge (){
|
||||
# no op
|
||||
echo -n
|
||||
}
|
||||
fi
|
||||
|
||||
|
|
|
|||
|
|
@ -24,15 +24,8 @@ 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} $(safe_battery_charge)
|
||||
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} "
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue