You are not logged in.
Hi all,
I'm looking for some simple CLI tool to give some battery information.
With battery info, I mean current power rate, available Wh, design Wh, last Wh when full.
acpi can provide only partial information on my system.
acpi -bi
Battery 0: Discharging, 83%, rate information unavailable
Battery 0: design capacity 4400 mAh, last full capacity 2607 mAh = 59%For some reason neither acpi not powertop can read the power rate of my system. (yes, I calibrated powertop)
However, the "gnome-power-statistics" GUI tool (gnome-power-manager package in extra) can indeed provide this info, as can the "wattson" plasmoid (kdeplasma-applets-wattson in AUR). I do not know how these obtain rate information and if they are any good.
I have no /proc/acpi/battery folder, but of course I have /sys/class/power_supply/BAT0/.
So I can get the info manually:
cat /sys/class/power_supply/BAT0/charge_nowHowever,
cat /sys/class/power_supply/BAT0/current_now
cat: /sys/class/power_supply/BAT0/current_now: No such deviceAny idea?
Last edited by OdinEidolon (2013-07-25 08:38:33)
Hardware: 2016 Dell XPS15 - matte FullHD - i5-6300HQ - 32GB DDR4 - Nvidia GTX960M - Samsung 840EVO 250GB SSD - 56Wh
Software: Plasma 5 - rEFInd - linux-ck - preload - prelink - verynice - psd - bumblebee
Offline
upower is a cli utility that can read those parameters, but I don't know which API it uses.
Offline
Do you have a uevent file in the /sys/class/power_supply/BAT0/ directory? Here, that file has all the info from the other files in that directory conveniently located. I used to grep that file for info, now I have a little c program that pops up a window telling me to unplug/plug in the ac.
You're just jealous because the voices only talk to me.
Offline
upower is a cli utility that can read those parameters, but I don't know which API it uses.
Thank you, I did not think of using upower.
And it does indeed show the rate!
Now, how does it calculate it? (I don't have time to look for it now, but I will tomorrow) I think it does just make the (numerical) derivative of the battery energy over time.
But why isn't rate it shown in /sys/class?
Hardware: 2016 Dell XPS15 - matte FullHD - i5-6300HQ - 32GB DDR4 - Nvidia GTX960M - Samsung 840EVO 250GB SSD - 56Wh
Software: Plasma 5 - rEFInd - linux-ck - preload - prelink - verynice - psd - bumblebee
Offline
Do you have a uevent file in the /sys/class/power_supply/BAT0/ directory? Here, that file has all the info from the other files in that directory conveniently located. I used to grep that file for info, now I have a little c program that pops up a window telling me to unplug/plug in the ac.
Thanks for that, yes I have it but does not show the rate. However, it is very useful for writing scripts.
Hardware: 2016 Dell XPS15 - matte FullHD - i5-6300HQ - 32GB DDR4 - Nvidia GTX960M - Samsung 840EVO 250GB SSD - 56Wh
Software: Plasma 5 - rEFInd - linux-ck - preload - prelink - verynice - psd - bumblebee
Offline