OpenBSD battery state - BSD
Users browsing this thread: 1 Guest(s)
|
|||
If, like me, you don't/didn't know how to get info about your battery state, at the command line, try these :-
sysctl hw.sensors apm -av apm -bv Hope that is useful to someone else. :) |
|||
|
|||
I'm sure it will be ;) Isn't there a file managed by the kernel exposing the battery state like /sys/power_supply/BAT0/capacity do on linux?
|
|||
|
|||
I have found sysctl hw.sensors.acpibat0 to get just the battery info.
|
|||
|
|||
you can echo the percentage like this:
battatm=$(sysctl -n hw.sensors.acpibat0.amphour3 | sed s/.A.*//) battfull=$(sysctl -n hw.sensors.acpibat0.amphour0 | sed s/.A.*//) load=`echo "${battatm} / ${battfull} * 100" | bc` echo ${load} |
|||
|
|||
yep. Found it back in '12 :)
|
|||
|
|||
Thanks for your post jvarg, I will give that a go.
|
|||