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}"
|
crit="${1:-15}"
|
||||||
stat="$(cat $bat/status)"
|
stat="$(cat $bat/status)"
|
||||||
perc="$(cat $bat/capacity)"
|
perc="$(cat $bat/capacity)"
|
||||||
|
file="$HOME/.config/waybar/scripts/lowbat"
|
||||||
|
|
||||||
notifysend() {
|
notifysend() {
|
||||||
local pid
|
local pid
|
||||||
@ -15,8 +16,13 @@ notifysend() {
|
|||||||
|
|
||||||
main() {
|
main() {
|
||||||
if [[ "$stat" == "Discharging" ]] && [[ "$perc" -le "$crit" ]] && [[ ! -f "$file" ]]; then
|
if [[ "$stat" == "Discharging" ]] && [[ "$perc" -le "$crit" ]] && [[ ! -f "$file" ]]; then
|
||||||
|
touch $file
|
||||||
notifysend
|
notifysend
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [[ "$stat" == "Charging" ]] && [[ -f $file ]]; then
|
||||||
|
rm $file
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
main $@
|
main $@
|
Loading…
x
Reference in New Issue
Block a user