[ale] Checking battery voltage on laptop

Jim Popovitch jimpop at yahoo.com
Tue Feb 15 21:11:58 EST 2005


On Tue, 2005-02-15 at 20:12 -0500, ringo wrote:
> Does anyone know how I can check my battery level on my laptop from
> within my gcc program? I have the power management stuff enabled so I
> have a battery bar on my desktop.
> Thanks
> Ringo
> Using SUSE 9.2 on a Compaq Presario
> 

Somewhere there is a lib that probably provides callable functions, but
if you want to get down and dirty just parse /proc/apm.  Google a bit
for "format /proc/apm" and you should find plenty.

-Jim P.





More information about the Ale mailing list