LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices

Reply
 
Search this Thread
Old 06-10-2013, 04:29 PM   #1
rabirk
Member
 
Registered: Dec 2012
Location: Maryland, US
Distribution: Debian
Posts: 83
Blog Entries: 5

Rep: Reputation: Disabled
How can I tell battery life from command line?


That's the extent of my question: When I'm using the command line (in runlevel 3), what command can I use to figure out how much battery life I have left? Yes, I've Googled and looked through the (outdated) Slackware Linux book and tried apropos battery, etc. I'm out of ideas (quickly, I know).
 
Old 06-10-2013, 04:39 PM   #2
ruario
Senior Member
 
Registered: Jan 2011
Location: Oslo, Norway
Distribution: Slackware
Posts: 1,783

Rep: Reputation: 797Reputation: 797Reputation: 797Reputation: 797Reputation: 797Reputation: 797Reputation: 797
Have a look at the info under /proc/acpi/battery/ and /sys/class/power_supply/
 
1 members found this post helpful.
Old 06-10-2013, 04:46 PM   #3
ruario
Senior Member
 
Registered: Jan 2011
Location: Oslo, Norway
Distribution: Slackware
Posts: 1,783

Rep: Reputation: 797Reputation: 797Reputation: 797Reputation: 797Reputation: 797Reputation: 797Reputation: 797
If you have trouble parsing that information you can install acpi from SlackBuilds.org and issue 'acpi -b', e.g. you will get something like this when plugged in:

Code:
$ acpi -b
Battery 0: Charging, 27%, 01:43:25 until charged
or something like this when running purely from battery

Code:
acpi -b
Battery 0: Discharging, 28%, 00:39:37 remaining

Last edited by ruario; 06-10-2013 at 04:47 PM.
 
2 members found this post helpful.
Old 06-10-2013, 05:21 PM   #4
rabirk
Member
 
Registered: Dec 2012
Location: Maryland, US
Distribution: Debian
Posts: 83
Blog Entries: 5

Original Poster
Rep: Reputation: Disabled
Thank you very much. The info in /proc/acpi/battery/BATO/state looks like exactly what I was looking for.
 
Old 06-11-2013, 06:35 AM   #5
zakame
Member
 
Registered: Apr 2012
Distribution: Debian, Ubuntu, Slackware
Posts: 119

Rep: Reputation: 42
On 14.0 you can also use the 'upower --monitor-detail' command to give you full information regarding the battery state. Also, on some specific laptops, there are certain modules than can give this information in files under /sys (like in the case of ThinkPads, there is the tp_smapi module set that provides battery info in /sys/devices/platform/smapi.)
 
1 members found this post helpful.
Old 06-11-2013, 08:24 PM   #6
glorsplitz
Member
 
Registered: Dec 2002
Distribution: slackware!
Posts: 244

Rep: Reputation: 26
also from slackbuilds, output from my a21m thinkpad

ibam --all
Bios percentage: 100 %
Battery percentage: 100 %
Soft low percentage limit: 5 %
Charge percentage: 100 %
Bios time left: 2:00:00
Battery time left: 1:54:00
Adapted battery time left: 1:54:00
Charge time left: 0:00:00
Adapted charge time left: 0:00:00
Total battery time: 1:54:00
Adapted total battery time: 1:54:00
Total charge time: 17:24:10
Adapted total charge time: 17:24:10
Profile logging enabled.
 
1 members found this post helpful.
  


Reply

Tags
battery, slackware


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Laptop Battery life.. Does Distro affect battery life?? jeevanism Linux - Hardware 6 07-09-2011 02:16 AM
command line monitoring of battery lmcilwain Fedora 1 08-05-2005 05:26 PM
Windows: 4-5 hour battery life, Gentoo : ~2:30 battery life numerous Linux - Laptop and Netbook 3 01-17-2005 08:39 PM
windows, good battery life -> fedora, bad battery life daedalusq1115 Linux - Laptop and Netbook 1 01-17-2005 06:40 AM
Command line battery monitor? rech Linux - Laptop and Netbook 3 04-14-2004 01:47 PM


All times are GMT -5. The time now is 09:27 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration