Add safeguard for no battery percentage available

This commit is contained in:
Nils Winkler
2017-05-31 07:36:07 +02:00
parent b55c0251ed
commit e13c75c433

View File

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