notifications
This commit is contained in:
@@ -1,6 +1,15 @@
|
||||
bat=$(cat /sys/class/power_supply/BAT0/capacity)
|
||||
stat=$(cat /sys/class/power_supply/AC/online)
|
||||
|
||||
if [[ $bat -le 20 ]]; then
|
||||
if [[ ! -f /tmp/battery_warning_send ]]; then
|
||||
dunstify -u "critical" "Battery warning!" "Battery is at ${bat}% - please attach charger!"
|
||||
touch /tmp/battery_warning_send
|
||||
fi
|
||||
else
|
||||
rm -f /tmp/battery_warning_send
|
||||
fi
|
||||
|
||||
if [ ! -d "/sys/class/power_supply/BAT0" ]; then
|
||||
bat="100"
|
||||
eww update batteryClass="batteryFull"
|
||||
@@ -8,6 +17,7 @@ if [ ! -d "/sys/class/power_supply/BAT0" ]; then
|
||||
elif [[ $stat == 1 ]]; then
|
||||
eww update batteryClass="batteryCharging"
|
||||
eww update batteryIcon=""
|
||||
eww update batterOver="true"
|
||||
elif [[ $bat -le 10 ]]; then
|
||||
eww update batteryClass="batteryEmpty"
|
||||
eww update batteryIcon=""
|
||||
|
||||
Reference in New Issue
Block a user