Want to check laptop battery level status from terminal. I have seen a suggestion of installing acpi.
Is there a way to check the battery level without extra programs (eg programs alreayd installed onto the machine)?
Want to check laptop battery level status from terminal. I have seen a suggestion of installing acpi.
Is there a way to check the battery level without extra programs (eg programs alreayd installed onto the machine)?
The "acpi" program is installed as part of the package "acpi", which I think is part of a standard install (type "which acpi" in a terminal window to see if "/usr/bin/acpi" is there).
Other than that, you can look at the file(s) in "/proc/acpi/battery", but without a utility program to translate the info that might be hard to understand.
Lloyd B.
Don't tell me to get a life.
I had one once.
It sucked.
Good luck!Code:$ sudo acpitools
/**HP Pavilion DV6646us laptop: AMD 1.9 GHz Turion 64 X2 / 2Gb RAM / 160Gb HDD / NVIDIA GeForce Go 7150M / 15.4" WXGA / BroadCom BCM4328 wireless / Built-in webcam **/
-- Kubuntu 9.04, CentOs 5.2, Mikrotik RouterOS 3.3 User -- Argentina LoCo Team
Code:cat /proc/acpi/battery/BAT0/state
100 buckets of bits on the bus,
100 buckets of bits,
Take one down, short it to ground,
FF buckets of bits on the bus.
I just tried this one. It shows the state but not in a human-readable format (eg its in mW and mWh instead of in hours or percentage). Any simple way of converting this?
Funny thing is, I ran file /proc/acpi/battery/BAT0/state, and the file was empty, yet 'cat'ting it gave input. Freaky phantom file contents ;D.
As said in the first post, I don't have/want acpi installed onto the laptop (trying to cut down on file system usage).
I found that apm was originally the program used instead of acpi, and saw that this was installed. But running "apm" in terminal gives "No APM support in kernel", which is throghouly unhelpful.
No searches so far have helped 'adding' support for apm.
The program acpitool was also not installed.
I think if you take the "remaining capacity" in mAh, divided by the "design capacity" in cat /proc/acpi/battery/BAT0/info, you'll get a percentage.
100 buckets of bits on the bus,
100 buckets of bits,
Take one down, short it to ground,
FF buckets of bits on the bus.
That gives a percentage of 75% when it should be 100%.
I disconnected the powercord and then:
09:03{~} cat /proc/acpi/battery/BAT1/state
present: yes
capacity state: ok
charging state: discharging
present rate: 22509 mW
remaining capacity: 39349 mWh
present voltage: 11340 mV
I did (remaining capacity)/(present rate). that gave me the time remaining in the battery. Still can't get a percentage though.
you can try this command in terminal to get deatails of batteryCode:upower -i /org/freedesktop/UPower/devices/battery_BAT0| grep -E "state|to\ full|percentage|time"
or may try this to view more details about your battery
http://sudevshares.blogspot.com/Code:upower -i /org/freedesktop/UPower/devices/battery_BAT0
Bookmarks