From 2607300bebf72b1f7483d33aa9d9f998ea8e531d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mois=C3=A9s=20Carvalho?= Date: Sat, 30 May 2020 11:51:16 -0300 Subject: [PATCH] Fix spacing when battery percentage isn't available --- scripts/battery.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/battery.sh b/scripts/battery.sh index ee33bdc..25dc32b 100755 --- a/scripts/battery.sh +++ b/scripts/battery.sh @@ -35,7 +35,8 @@ battery_percent() # Check OS case $(uname -s) in Linux) - linux_acpi percent + percent=$(linux_acpi percent) + [ -n "$percent" ] && echo " $percent" ;; Darwin) @@ -74,7 +75,7 @@ battery_status() if [ $status = 'discharging' ] || [ $status = 'Discharging' ]; then echo '' else - echo 'AC ' + echo 'AC' fi }