From 11469fe235937811cc6d34d2b0e14a94d8f632d6 Mon Sep 17 00:00:00 2001 From: Nils Winkler Date: Wed, 31 May 2017 07:42:57 +0200 Subject: [PATCH] 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. --- themes/atomic/atomic.theme.bash | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/themes/atomic/atomic.theme.bash b/themes/atomic/atomic.theme.bash index 4e58f014..3df4e7ce 100644 --- a/themes/atomic/atomic.theme.bash +++ b/themes/atomic/atomic.theme.bash @@ -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