Add safeguard for no battery percentage available

pull/974/head
Nils Winkler 2017-05-31 07:36:07 +02:00
parent b55c0251ed
commit e13c75c433
1 changed files with 3 additions and 1 deletions

View File

@ -153,7 +153,9 @@ ___brainy_prompt_clock() {
___brainy_prompt_battery() { ___brainy_prompt_battery() {
! command_exists battery_percentage || ! command_exists battery_percentage ||
[ "${THEME_SHOW_BATTERY}" != "true" ] && return [ "${THEME_SHOW_BATTERY}" != "true" ] ||
[ "$(battery_percentage)" = "no" ] && return
info=$(battery_percentage) info=$(battery_percentage)
color=$bold_green color=$bold_green
if [ "$info" -lt 50 ]; then if [ "$info" -lt 50 ]; then