|
|
@ -10,11 +10,11 @@ while true; do |
|
|
|
if [[ "$status" =~ "Charging" ]]; then |
|
|
|
if [[ "$status" =~ "Charging" ]]; then |
|
|
|
was_notified=0 |
|
|
|
was_notified=0 |
|
|
|
fi |
|
|
|
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"& |
|
|
|
xmessage -nearmouse "$acpi_data"& |
|
|
|
was_notified=1 |
|
|
|
was_notified=1 |
|
|
|
fi |
|
|
|
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 -& |
|
|
|
bash -c 'echo "Battery critical, suspending"; acpi -b' | xmessage -nearmouse -file -& |
|
|
|
sleep 5 |
|
|
|
sleep 5 |
|
|
|
systemctl suspend |
|
|
|
systemctl suspend |
|
|
|