Decrease battery percentage before warning

master
Lars Vierbergen 7 years ago
parent d19e40cc44
commit f919fda818
  1. 4
      battery-monitor.sh

@ -10,11 +10,11 @@ while true; do
if [[ "$status" =~ "Charging" ]]; then
was_notified=0
fi
if [[ "$status" =~ "Discharging" && "$capacity" -lt 25 && "$was_notified" = 0 ]]; then
if [[ "$status" =~ "Discharging" && "$capacity" -lt 15 && "$was_notified" = 0 ]]; then
xmessage -nearmouse "$acpi_data"&
was_notified=1
fi
if [[ "$status" =~ "Discharging" && "$capacity" -lt 15 ]]; then
if [[ "$status" =~ "Discharging" && "$capacity" -lt 10 ]]; then
bash -c 'echo "Battery critical, suspending"; acpi -b' | xmessage -nearmouse -file -&
sleep 5
systemctl suspend

Loading…
Cancel
Save