chore(waybar): update config
This commit is contained in:
@@ -1,18 +1,17 @@
|
||||
#!/bin/sh
|
||||
#! /usr/bin/env bash
|
||||
|
||||
bat=/sys/class/power_supply/BAT1
|
||||
CRIT=${1:-15}
|
||||
FILE=~/.config/waybar/scripts/.low_bat
|
||||
|
||||
FILE=~/.config/waybar/scripts/notified
|
||||
bat="/sys/class/power_supply/BAT1"
|
||||
CRIT="${1:-15}"
|
||||
stat="$(cat $bat/status)"
|
||||
perc="$(cat $bat/capacity)"
|
||||
|
||||
stat=$(cat $bat/status)
|
||||
perc=$(cat $bat/capacity)
|
||||
if [[ $perc -le $CRIT ]] && [[ "$stat" == "Discharging" ]] && [[ ! -f "$FILE" ]]; then
|
||||
notify-send --urgency=critical --icon=dialog-warning "Battery Low" "Current charge: $perc%"
|
||||
touch $FILE
|
||||
fi
|
||||
|
||||
if [[ $perc -le $CRIT ]] && [[ $stat == "Discharging" ]]; then
|
||||
if [[ ! -f "$FILE" ]]; then
|
||||
notify-send --urgency=critical --icon=dialog-warning "Battery Low" "Current charge: $perc%"
|
||||
touch $FILE
|
||||
fi
|
||||
elif [[ -f "$FILE" ]]; then
|
||||
if [[ -f "$FILE" ]] && [[ "$stat" == "Charging" ]]; then
|
||||
rm $FILE
|
||||
fi
|
Reference in New Issue
Block a user