Hallo Stefan, Le Thursday 07 May 2015 à 21:09 +0200, Stefan Seyfried a écrit :
Am 06.05.2015 um 14:22 schrieb Jean Delvare:
The following should work except for the "rate" which isn't mentioned in the sysfs interface. I seem to understand that this isn't considered a property of the battery so you have to derive it yourself from the the other numbers over an arbitrary period.
"power_now" is basically what the "rate" was, but it's expressed in microwatts while in /proc it could be either mA or mW IIRC.
Baah, thanks for pointing out the obvious, I must have been blind :( Whatever the unit is, it's impressively undocumented. So anyway Gerald's script can be simplified again to: #!/bin/bash sum() { s=0; while read i; do i=$(($i/1000)) printf "%5s " "$i" s=$(($s+$i)) done printf " = %s\n" "$s" } for v in "energy_full_design" "energy_full" "energy_now" "power_now"; do printf "%18s = " "$v" cat /sys/class/power_supply/BAT*/$v | sum done -- Jean Delvare SUSE L3 Support -- To unsubscribe, e-mail: opensuse-kernel+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-kernel+owner@opensuse.org