dot/scripts/battery_level

5 lines
149 B
Text
Raw Normal View History

2023-03-01 00:15:29 +00:00
#!/bin/sh
full=$(cat /sys/class/power_supply/BAT0/charge_now)
now=$(cat /sys/class/power_supply/BAT0/charge_full)
echo $full / $now \* 100 | bc -l