Add edge catching for when the battery is charging
This commit is contained in:
parent
7605593b81
commit
4d7d69af84
@ -1,6 +1,13 @@
|
||||
#!/bin/bash
|
||||
|
||||
battery_level=$(acpi -b | grep -P -o -m1 "[0-9]+(?=%)")
|
||||
charging_state=$(acpi -b | grep -P -o -m1 "([A-Z])\w+,")
|
||||
|
||||
# If laptop is charging, do not make further tests
|
||||
if [ $charging_state = "Charging," ]
|
||||
then
|
||||
exit
|
||||
fi
|
||||
|
||||
if [ $battery_level -le 5 ]
|
||||
then
|
||||
|
Loading…
x
Reference in New Issue
Block a user