chore(waybar): update waybar config

This commit is contained in:
Andrea 2025-05-25 10:18:17 +02:00
parent e17cd72683
commit e29e81c116

View File

@ -4,6 +4,7 @@ bat="/sys/class/power_supply/BAT1"
crit="${1:-15}"
stat="$(cat $bat/status)"
perc="$(cat $bat/capacity)"
file="$HOME/.config/waybar/scripts/lowbat"
notifysend() {
local pid
@ -15,8 +16,13 @@ notifysend() {
main() {
if [[ "$stat" == "Discharging" ]] && [[ "$perc" -le "$crit" ]] && [[ ! -f "$file" ]]; then
touch $file
notifysend
fi
if [[ "$stat" == "Charging" ]] && [[ -f $file ]]; then
rm $file
fi
}
main $@