Power Status (was Re: Because LC can't do two things at once.)

Peter M. Brigham pmbrig at gmail.com
Sun Mar 1 20:01:47 EST 2015


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
pmbrig at gmail.com
http://home.comcast.net/~pmbrig





More information about the use-livecode mailing list