diff options
author | InigoGutierrez <inigogf.95@gmail.com> | 2019-12-17 22:20:14 +0100 |
---|---|---|
committer | InigoGutierrez <inigogf.95@gmail.com> | 2019-12-17 22:20:14 +0100 |
commit | fe934727c9e833bedbcbc7a9f933256e564bafcc (patch) | |
tree | f2770b169623970c2fb8e39d94a4dbe48418b375 /i3blocks | |
parent | f551289c9705c5ed2a028f9a6d37b13c98467508 (diff) | |
download | scripts-fe934727c9e833bedbcbc7a9f933256e564bafcc.tar.gz scripts-fe934727c9e833bedbcbc7a9f933256e564bafcc.zip |
i3battery.sh exits if no battery defined.
Diffstat (limited to 'i3blocks')
-rwxr-xr-x | i3blocks/i3battery.sh | 1 |
1 files changed, 1 insertions, 0 deletions
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" |