From c29434338f11e6ca0cdb7dac3669fea349542c9c Mon Sep 17 00:00:00 2001 From: Anish L Date: Sat, 3 Sep 2022 16:21:06 +1000 Subject: [PATCH] fix up battery-low-timer --- profiles/desktop/battery-low-timer.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/profiles/desktop/battery-low-timer.nix b/profiles/desktop/battery-low-timer.nix index c4110280..d3fc1eec 100644 --- a/profiles/desktop/battery-low-timer.nix +++ b/profiles/desktop/battery-low-timer.nix @@ -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