We have moved to a new Sailfish OS Forum. Please start new discussions there.
3

Shell command to check battery status? [answered]

asked 2015-01-10 09:19:12 +0200

tobixen gravatar image

updated 2015-12-26 21:14:08 +0200

piero gravatar image

Does there exist any command to check the battery status? (From my laptop, I usually use "acpi")

edit retag flag offensive reopen delete

The question has been closed for the following reason "the question is answered, an answer was accepted" by eric
close date 2015-01-12 10:34:38.463969

2 Answers

Sort by » oldest newest most voted
12

answered 2015-01-10 10:34:42 +0200

r0kk3rz gravatar image

updated 2015-01-10 11:23:11 +0200

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
edit flag offensive delete publish link more
11

answered 2015-01-10 10:28:56 +0200

filipb92 gravatar image

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

edit flag offensive delete publish link more

Comments

cool, useful

tobixen ( 2015-01-10 11:37:43 +0200 )edit

nice thanks

Mr.Thumb ( 2015-05-03 21:59:20 +0200 )edit

upower was dropped in 2.0.1 Taalojärvi. Is there a substitute?

objectifnul ( 2016-05-14 09:49:30 +0200 )edit

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 +0200 )edit

Question tools

Follow
2 followers

Stats

Asked: 2015-01-10 09:19:12 +0200

Seen: 2,605 times

Last updated: Jan 10 '15