add old dotfiles (probably gonna rewrite them anyways but will be enough for now)

This commit is contained in:
smayzy
2025-06-18 18:31:59 +02:00
parent 7261502a3c
commit 31ddf52257
191 changed files with 1669 additions and 1 deletions
+25
View File
@@ -0,0 +1,25 @@
#!/bin/bash
BAT=$(ls /sys/class/power_supply | grep -E '^BAT' | head -n 1)
while true; do
capacity=$(cat "/sys/class/power_supply/${BAT}/capacity")
BATSTATUS=$(cat "/sys/class/power_supply/${BAT}/status")
if [ -f "/sys/class/power_supply/${BAT}/power_now" ]; then
power_now=$(cat "/sys/class/power_supply/${BAT}/power_now")
power_watt=$(echo "scale=1; $power_now / 1000000" | bc)
else
power_watt="N/A"
fi
if [ "$BATSTATUS" == "Discharging" ]; then
if [ "$capacity" -le 20 ]; then
notify-send -u critical "Battery Warning!" \
"Battery is at ${capacity}% discharging at a rate of ${power_watt}W."
fi
fi
sleep 120
done