chore(waybar): update waybar config
This commit is contained in:
parent
e17cd72683
commit
e29e81c116
@ -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 $@
|
Loading…
x
Reference in New Issue
Block a user