fix up battery-low-timer

This commit is contained in:
Anish L 2022-09-03 16:21:06 +10:00
parent 151edaab9b
commit c29434338f

View file

@ -9,15 +9,15 @@
startAt = "*08:00:00"; startAt = "*08:00:00";
script = '' script = ''
#!/usr/bin/env bash #!/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 # Discharging
# Monitor for low battery # Monitor for low battery
if [ `acpi -b | grep "Battery 2" | awk ' { print ($4)-0}'` -le "15" ] ; then if [ `acpi -b | grep "Battery 0" | awk ' { print ($4)-0}'` -le "15" ] ; then
notify-send "Battery Low"; notify-send -u critical "Battery Low";
fi fi
else else
# Charging # 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 # Fully charged
notify-send "Battery Full" notify-send "Battery Full"
fi fi