From 84da0955a9da5c8af8c5a66aa948d469cf9adcc3 Mon Sep 17 00:00:00 2001 From: Syndamia Date: Fri, 17 Mar 2023 11:47:52 +0200 Subject: [.a/bs] Fixed discharge notification being spammed and multiple being sent out --- .a/battery-status.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.a/battery-status.sh b/.a/battery-status.sh index dcfae2d..2ad7157 100755 --- a/.a/battery-status.sh +++ b/.a/battery-status.sh @@ -41,7 +41,9 @@ if [ $bat_state = 'c' ]; then # Notify when battery discharges to 5%, 10%, 15% and 20% elif [ $bat_state = 'd' ]; then for per in 5 10 15 20; do - if [ "$bat_notif" != $per ] && [ $bat_per -le $per ]; then + if [ "$bat_notif" = $per ]; then + break + elif [ $bat_per -le $per ]; then notify-send -u critical -i battery-low -t 999999 "Battery ${per}%" echo $per > /tmp/bat_notif break -- cgit v1.2.3