Added battery health and made it configurable

This commit is contained in:
EinBowser
2025-11-01 20:50:39 +01:00
parent daf7d2c9dc
commit b267b74e8b
4 changed files with 58 additions and 0 deletions
@@ -0,0 +1,11 @@
#!/bin/bash
# This just guesses that the BAT0 is the actuall battery
full=$(cat /sys/class/power_supply/BAT0/charge_full)
design=$(cat /sys/class/power_supply/BAT0/charge_full_design)
if [ "$design" -gt 0 ]; then # basically if design > 0
awk "BEGIN { printf \"%.1f\n\", ($full/$design)*100 }"
else
echo "Error"
fi