fix up battery-low-timer
This commit is contained in:
parent
151edaab9b
commit
c29434338f
|
@ -9,15 +9,15 @@
|
|||
startAt = "*08:00:00";
|
||||
script = ''
|
||||
#!/usr/bin/env bash
|
||||
if [ `acpi -b | grep "Battery 2" | awk ' { print ($3)}'` == "Discharging," ] ; then
|
||||
if [ `acpi -b | grep "Battery 0" | awk ' { print ($3)}'` == "Discharging," ] ; then
|
||||
# Discharging
|
||||
# Monitor for low battery
|
||||
if [ `acpi -b | grep "Battery 2" | awk ' { print ($4)-0}'` -le "15" ] ; then
|
||||
notify-send "Battery Low";
|
||||
if [ `acpi -b | grep "Battery 0" | awk ' { print ($4)-0}'` -le "15" ] ; then
|
||||
notify-send -u critical "Battery Low";
|
||||
fi
|
||||
else
|
||||
# Charging
|
||||
if [ `acpi -b | grep "Battery 2" | awk ' { print ($4)-0}'` -ge "98" ] ; then
|
||||
if [ `acpi -b | grep "Battery 0" | awk ' { print ($4)-0}'` -ge "94" ] ; then
|
||||
# Fully charged
|
||||
notify-send "Battery Full"
|
||||
fi
|
||||
|
|
Loading…
Reference in a new issue