diff options
author | InigoGutierrez <inigogf.95@gmail.com> | 2019-10-29 19:51:58 +0100 |
---|---|---|
committer | InigoGutierrez <inigogf.95@gmail.com> | 2019-10-29 19:51:58 +0100 |
commit | 38110ef852373765de0c738aa54587b9ee640389 (patch) | |
tree | ddab8ea8b2338235b969d90665d1cd3fcc668cae /i3blocks/i3battery.sh | |
parent | 756f1c152ef3ca8f34a6f419b19b3ac254a5ada2 (diff) | |
download | scripts-38110ef852373765de0c738aa54587b9ee640389.tar.gz scripts-38110ef852373765de0c738aa54587b9ee640389.zip |
Random changes.
Diffstat (limited to 'i3blocks/i3battery.sh')
-rwxr-xr-x | i3blocks/i3battery.sh | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/i3blocks/i3battery.sh b/i3blocks/i3battery.sh index 1278eeb..51dfa37 100755 --- a/i3blocks/i3battery.sh +++ b/i3blocks/i3battery.sh @@ -12,8 +12,8 @@ case $BLOCK_BUTTON in esac status=$(cat /sys/class/power_supply/"$1"/status) -capacity=$(cat /sys/class/power_supply/"$1"/capacity) || exit -remaining=$(acpi | cut -d' ' -f5 | cut -d':' -f-2) +capacity=$(cat /sys/class/power_supply/"$1"/capacity) || exit 0 +[ -f "/bin/acpi" ] && remaining="$(acpi | cut -d' ' -f5 | cut -d':' -f-2)" || remaining="missing acpi" if [ "$capacity" -ge 80 ]; then color="#b8bb26" |