Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re^3: Laptop Battery Percentage

by jimmy.tty (Sexton)
on Aug 02, 2011 at 23:36 UTC ( #918153=note: print w/ replies, xml ) Need Help??


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

I use this code in gnu screen's statusbar:

backtick 1 1 1 sh -c 'perl -ne "/^(la|re|st)[^:]+:\s+(\S+)\s/and \$h{\ +$1}=\$2}{\$h{st}=~s/of.*/-/;\$h{st}=~s/on.*/+/;printfq(%.0f%%%s),\$h{ +re}*100/\$h{la},\$h{st}" /proc/acpi/battery/BAT0/* /proc/acpi/ac_adap +ter/ACAD/state'


Comment on Re^3: Laptop Battery Percentage
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (4)
As of 2014-07-26 11:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (175 votes), past polls