dot/scripts/battery_level
2023-03-01 00:15:29 +00:00

4 lines
149 B
Bash
Executable file

#!/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