Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re^3: Laptop Battery Percentage

by strredwolf (Chaplain)
on Aug 05, 2011 at 03:18 UTC ( #918671=note: print w/ replies, xml ) Need Help??


in reply to Re^2: Laptop Battery Percentage
in thread Laptop Battery Percentage

But what if you have two batteries? Some laptops allow that. You will have multiple lines.

Information doesn't want to be free. It wants to be feline.


Comment on Re^3: Laptop Battery Percentage
Re^4: Laptop Battery Percentage
by Tux (Monsignor) on Aug 05, 2011 at 07:16 UTC

    Accumulate? Untested concept:

    $ perl -MDP -e'while(<>){/^(.*)\s+capacity:\s*((\d+).*)/||next;$i{$1}[ +0]+=$2;$i{$1}[1]//=$3}print"$_: $i{$_}[0], "for keys%i;printf"%5.1f%% +\n",100*$i{remaining}[1]/$i{design}[1]' /proc/acpi/battery/*/*

    Enjoy, Have FUN! H.Merijn

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://918671]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (8)
As of 2015-07-06 23:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (85 votes), past polls