mirror of
https://github.com/end-4/dots-hyprland.git
synced 2026-06-05 23:09:26 -05:00
changed the script to the right name, added some info and removed unnecesary debug
This commit is contained in:
+6
-1
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user