check_battery: disable notification when charging

This commit is contained in:
Guilherme Rugai Freire 2026-02-11 01:08:13 -03:00
parent 3d66555b9b
commit 2ff33939d2
No known key found for this signature in database
GPG Key ID: DCFA7949937FB2CD

View File

@ -6,6 +6,10 @@ time="$(upower -i $DEVICE | grep time | cut -d':' -f2 | tr -s ' ' | cut -c2-)"
perc="$(upower -i $DEVICE | grep percentage | awk '{print $2}' | tr -d '%')" perc="$(upower -i $DEVICE | grep percentage | awk '{print $2}' | tr -d '%')"
stat="$(upower -i $DEVICE | grep state | awk '{print $2}')" stat="$(upower -i $DEVICE | grep state | awk '{print $2}')"
if [ "$stat" = "charging" ]; then
exit 0
fi
if [ "$perc" -le "20" ]; then if [ "$perc" -le "20" ]; then
urgency="normal" urgency="normal"
if [ "$perc" -le "10" ]; then if [ "$perc" -le "10" ]; then