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.
This commit is contained in:
Nils Winkler
2017-05-31 07:42:57 +02:00
parent e13c75c433
commit 11469fe235

View File

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