From 150e174f3293490c44e4bd96f79a05ae451c90c6 Mon Sep 17 00:00:00 2001 From: Manuel Palenzuela Date: Wed, 3 Jul 2019 00:05:47 +0200 Subject: Improved battery icon logic --- scripts/dwm-status | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/scripts/dwm-status b/scripts/dwm-status index 0cf2498..b1671fa 100755 --- a/scripts/dwm-status +++ b/scripts/dwm-status @@ -169,8 +169,16 @@ status() { \ 8[0-9]|7[0-9]) echo " $(cat $x)%" ;; 6[0-9]|5[0-9]) echo " $(cat $x)%" ;; 4[0-9]|3[0-9]) echo " $(cat $x)%" ;; - 2[0-9]|1[0-9]) echo "  $(cat $x)%" ;; - [0-9]) echo "  $(cat $x)%" ;; + 2[0-9]|1[0-9]) if [ "$ac_adapter" == "on" ]; then + echo " $(cat $x)%" + else + echo "  $(cat $x)%" + fi ;; + [0-9]) if [ "$ac_adapter" == "on" ]; then + echo " $(cat $x)%" + else + echo "  $(cat $x)%" + fi ;; esac done && echo "$delim" -- cgit 1.4.1