Fix battery_percentage check in Atomic theme

Check for the return value "no", which is returned when no battery check funcationality is available in the OS. This is now consistent with how the Brainy theme does this.
pull/974/head
Nils Winkler 2017-05-31 07:42:57 +02:00
parent e13c75c433
commit 11469fe235
1 changed files with 4 additions and 2 deletions

View File

@ -164,8 +164,10 @@ ___atomic_prompt_clock() {
} }
___atomic_prompt_battery() { ___atomic_prompt_battery() {
chk=$(command_exists battery_percentage && echo yes || echo no) ! command_exists battery_percentage ||
[ "$chk" != "yes" ] || [ "${THEME_SHOW_BATTERY}" != "true" ] && return [ "${THEME_SHOW_BATTERY}" != "true" ] ||
[ "$(battery_percentage)" = "no" ] && return
batp=$(battery_percentage) batp=$(battery_percentage)
if [ "$batp" -eq 50 ] || [ "$batp" -gt 50 ]; then if [ "$batp" -eq 50 ] || [ "$batp" -gt 50 ]; then
color=$bold_green color=$bold_green