diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2014-05-05 15:15:47 -0300 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2014-05-05 15:15:47 -0300 |
commit | 2bb9841434e3be1e1735c7b024c4d0572935f639 (patch) | |
tree | fd80c5fec195fec5d0ee02bd9244163cea02af81 /battery | |
parent | 5dc23d23b5c09c87d74538dd52eb5d2dbe78e8e3 (diff) | |
download | scripts-2bb9841434e3be1e1735c7b024c4d0572935f639.tar.gz scripts-2bb9841434e3be1e1735c7b024c4d0572935f639.tar.bz2 |
Abort if no battery is available
Diffstat (limited to 'battery')
-rwxr-xr-x | battery | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -29,6 +29,11 @@ function battery_capacity { healthy='#859900' low='#b58900' discharge='#dc322f' + +# Abort if no battery is available +if [ ! -e "/sys/class/power_supply/BAT0" ]; then + exit +fi # Get battery status if [ -e "/sys/class/power_supply/BAT0/charge" ]; then |