# Simple script that reads the battery capacity every 30 seconds and logs it to a file # Used to measure how long the battery lasts for when idle while [ 1 ] do echo $(date) $(cat /sys/class/power_supply/pm8916-bms-vm/capacity) >> battery.log sleep 30 done