changed the script to the right name, added some info and removed unnecesary debug

This commit is contained in:
EinBowser
2025-11-01 22:22:58 +01:00
parent ca7d6c8ae0
commit 6676d5844b
2 changed files with 6 additions and 2 deletions
@@ -1,6 +1,7 @@
#!/bin/bash
# This just guesses that the BAT0 is the actuall battery
# because BAT0 is the default for modern systems
full=$(cat /sys/class/power_supply/BAT0/charge_full)
design=$(cat /sys/class/power_supply/BAT0/charge_full_design)
@@ -8,4 +9,8 @@ if [ "$design" -gt 0 ]; then # basically if design > 0
awk "BEGIN { printf \"%.1f\n\", ($full/$design)*100 }"
else
echo "Error"
fi
fi
# If you have any issues try to find your "real" battery.
# Run 'ls /sys/class/power_supply'. You may see BATM or BAT1 and no BAT0
# You can check what is what my running 'cat /sys/class/power_supply/{whatever_you_got}/model_name'
@@ -46,7 +46,6 @@ Singleton {
const value = Number(output)
if (!isNaN(value)) {
root.health = value
console.log("Battery health:", value)
} else {
console.warn("Battery script output invalid:", output)
}