chore: add sway and waybar config

This commit is contained in:
Andrea
2024-01-27 13:45:42 +01:00
parent 1b4698d5c4
commit 711fbea929
4 changed files with 564 additions and 0 deletions

18
waybar/scripts/check_battery.sh Executable file
View File

@@ -0,0 +1,18 @@
#!/bin/sh
bat=/sys/class/power_supply/BAT1
CRIT=${1:-15}
FILE=~/.config/waybar/scripts/notified
stat=$(cat $bat/status)
perc=$(cat $bat/capacity)
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
rm $FILE
fi