From fe934727c9e833bedbcbc7a9f933256e564bafcc Mon Sep 17 00:00:00 2001 From: InigoGutierrez Date: Tue, 17 Dec 2019 22:20:14 +0100 Subject: i3battery.sh exits if no battery defined. --- i3blocks/i3battery.sh | 1 + 1 file changed, 1 insertion(+) (limited to 'i3blocks/i3battery.sh') diff --git a/i3blocks/i3battery.sh b/i3blocks/i3battery.sh index 1be8142..256b199 100755 --- a/i3blocks/i3battery.sh +++ b/i3blocks/i3battery.sh @@ -12,6 +12,7 @@ case $BLOCK_BUTTON in esac battery="$CONFIG_BATTERY" +[ -n "$battery" ] || exit 0 status=$(cat /sys/class/power_supply/"$battery"/status) capacity=$(cat /sys/class/power_supply/"$battery"/capacity) || exit 0 [ -f "/bin/acpi" ] && remaining="$(acpi | cut -d' ' -f5 | cut -d':' -f-2)" || remaining="missing acpi" -- cgit v1.2.1