Shell command to check battery status? [answered]
Does there exist any command to check the battery status? (From my laptop, I usually use "acpi")
Does there exist any command to check the battery status? (From my laptop, I usually use "acpi")
upower -d
will give you all kinds of battery stats
Device: /org/freedesktop/UPower/devices/battery_battery
native-path: battery
power supply: yes
updated: Sat Jan 10 09:22:09 2015 (19 seconds ago)
has history: yes
has statistics: yes
battery
present: yes
rechargeable: yes
state: fully-charged
energy: 7.43432 Wh
energy-empty: 0 Wh
energy-full: 7.79 Wh
energy-full-design: 7.98 Wh
energy-rate: 0.511242 W
voltage: 4.30687 V
percentage: 100%
temperature: 27.5 degrees C
capacity: 97.619%
technology: lithium-ion
History (rate):
1420881667 0.511 fully-charged
1420881666 0.016 fully-charged
1420881664 0.511 fully-charged
in /sys/class/power_supply/battery/ you can find all information about the battery in /sys/class/power_supply/usb/ all about usb (power) in /sys/class/power_supply/pm8921-dc all about the charger
battery charge level example: cat /sys/class/power_supply/battery/capacity returns the charge level percentage as show on the screen
upower was dropped in 2.0.1 Taalojärvi. Is there a substitute?
objectifnul ( 2016-05-14 09:49:30 +0300 )As of 2.0.1 you can query /run/statefs for this which is a wrapper around sysfs.
Thaodan ( 2016-06-04 18:22:45 +0300 )Asked: 2015-01-10 09:19:12 +0300
Seen: 2,735 times
Last updated: Jan 10 '15