forked from Shinonome/dots-hyprland
Added battery health and made it configurable
This commit is contained in:
@@ -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
|
||||
Reference in New Issue
Block a user