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

Is there any way to check charge status from the terminal?

asked 2014-04-22 14:32:48 +0300

icebox gravatar image

updated 2014-08-27 11:14:38 +0300

jiit gravatar image


I'm using a script on my NAS to rdiff-backup my phone when it's in the home network. I would like to tune this script to only start if the phone has at least say 80% charge. Is there any way to check the charge level from the terminal?


edit retag flag offensive close delete

1 Answer

Sort by » oldest newest most voted

answered 2014-04-22 15:01:20 +0300

qUAp gravatar image

Try to cat the modules in /sys/class/power_supply/battery, there you can get all the information you need about the battery.

edit flag offensive delete publish link more


Thanks for pointing me to the right direction. Specifically what I will use in my script are:

/sys/class/power_supply/battery/capacity - gives the charge percentage, no math required

/sys/class/power_supply/battery/status - charging / discharging

icebox ( 2014-04-22 15:05:19 +0300 )edit
Login/Signup to Answer

Question tools

1 follower


Asked: 2014-04-22 14:32:48 +0300

Seen: 389 times

Last updated: Apr 22 '14