dotfiles/dot_bin/executable_power_record

16 lines
414 B
Plaintext
Raw Normal View History

2021-02-15 20:53:16 -05:00
#! /bin/bash
# simple script to output the current current (lol) and current
# voltage of the battery every second. Record this to a file, multiply,
# and find power...absolute...POOOOOOWEEEER!!!!!!
for i in $(seq "$1"); do
## in uC
I=$(cat /sys/class/power_supply/BAT0/current_now)
## in uV
V=$(cat /sys/class/power_supply/BAT0/voltage_now)
## in pW
echo $(( I * V ))
sleep 1.0
done