I don't know if this helps since the only linux system i have is a raspberryPi, but I get a file not found message when typing cat /proc/acpi/battery/BAT1/state in a terminal window.

-= Mike



On 3/1/15 8:01 PM, Peter M. Brigham wrote:
On Mar 1, 2015, at 3:16 PM, Richard Gaskin wrote:

Peter M. Brigham wrote:

Just closing the loop on this one (the power source of a laptop).
(Calling Richard Gaskin re the Linux case...)
Thanks, Peter.

I'd provided what I think might work some time ago, lost in the long thread as 
it's run across many topics (hence my taking the liberty of changing the thread 
title):
<http://lists.runrev.com/pipermail/use-livecode/2015-February/211587.html>

If anyone here running Linux could test that on their system to see if it works 
as well for you as it does for me we have have all three platforms now covered.

Thanks again for putting the handler together, Peter.
Yes, I did get that message:

Thanks to the beautiful simplicity of the Linux /proc directory I was
able to find:

    cat /proc/acpi/battery/BAT1/state

The "charging state" field there will contain "charging" or "discharging".
Question: this looks like a file on disk. I didn't know what you meant by the 
"'charging state' field." What is the format of the file? Is this a text file, 
an XML file, or something else? If you could give me a sample to look at I can parse it 
to get the info and complete the handler. I don't have a linux system to work with for 
this.

-- Peter

Peter M. Brigham
pmb...@gmail.com
http://home.comcast.net/~pmbrig


_______________________________________________
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


_______________________________________________
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Reply via email to