From f919fda81809102fd17a3fdc6aa745d85882b422 Mon Sep 17 00:00:00 2001 From: Lars Vierbergen Date: Sat, 7 Apr 2018 16:34:21 +0200 Subject: [PATCH] Decrease battery percentage before warning --- battery-monitor.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/battery-monitor.sh b/battery-monitor.sh index 0016570..b89c21c 100755 --- a/battery-monitor.sh +++ b/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