aboutsummaryrefslogtreecommitdiff
path: root/i3blocks/i3battery.sh
diff options
context:
space:
mode:
authorInigoGutierrez <inigogf.95@gmail.com>2019-10-29 19:51:58 +0100
committerInigoGutierrez <inigogf.95@gmail.com>2019-10-29 19:51:58 +0100
commit38110ef852373765de0c738aa54587b9ee640389 (patch)
treeddab8ea8b2338235b969d90665d1cd3fcc668cae /i3blocks/i3battery.sh
parent756f1c152ef3ca8f34a6f419b19b3ac254a5ada2 (diff)
downloadscripts-38110ef852373765de0c738aa54587b9ee640389.tar.gz
scripts-38110ef852373765de0c738aa54587b9ee640389.zip
Random changes.
Diffstat (limited to 'i3blocks/i3battery.sh')
-rwxr-xr-xi3blocks/i3battery.sh4
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"