This commit is contained in:
2024-03-30 15:33:51 +00:00
parent 6dc690f076
commit 48851af0d8
3 changed files with 19 additions and 1 deletions
+1 -1
View File
@@ -319,7 +319,7 @@
"󰁹" "󰁹"
], ],
"on-click": "", "on-click": "",
"on-update": "/home/liamm/.config/waybar/scripts/battery-warn.py 255", "on-update": "/home/liamm/.config/waybar/scripts/battery-warn.sh 255",
"tooltip": true "tooltip": true
} }
} }
Binary file not shown.
+18
View File
@@ -0,0 +1,18 @@
#!/usr/bin/env bash
notif_id=$1
bat_alert_lvl=15
bat_lvl=$(grep "" /sys/class/power_supply/BAT0/capacity )
bat_status=$(grep Discharging /sys/class/power_supply/BAT0/status )
if (( $bat_lvl < $bat_alert_lvl )) && [ $bat_status == "Discharging" ]; then
dunstify -u critical "Low Battery" "Connect Power Adapter" -i /usr/share/icons/Adwaita/symbolic/status/battery-caution-symbolic.svg -r $notif_id -t 60000
else
hist_check=$(dunstctl history | grep $notif_id)
if [[ $hist_check == "" ]]; then
dunstctl close
fi
dunstctl history-rm $notif_id
fi