[PLUG] Laptop battery time remaining with acpi, not apm
Rogan Creswick
creswick at cs.orst.edu
Wed Oct 29 15:54:02 UTC 2003
On Wed, Oct 29, 2003 at 02:06:57PM -0800, Rich Shepard wrote:
> On my older portable running apm, I could 'cat /proc/apm' to see the
> operating time remaining on the battery. On the new laptop, when I use 'less
> /proc/acpi/battery/BAT1/info' I see milliwatt hours, not hours and minutes.
/proc/acpi/battery/BAT1/ contains info, status and alarm "files".
info seems to be pretty static, however status gives a present rate (in mA),
and remaining capacity(mAh) entries.
mAh/mA = h => capacity/rate=time left. IIRC, the sign changes on the
rate when you are charging the battery, so you can also get the time
to a full charge this way.
The gnome battery applet also does the conversion for you, if you're
into the gui thing.
If you do find/write a script, I'd like to use it also :)
-Rogan
>
> Is there a way to find the remaining time -- in hours:minutes -- from
> acpi?
>
> TIA,
>
> Rich
>
> Dr. Richard B. Shepard, President
>
> Applied Ecosystem Services, Inc. (TM)
> 2404 SW 22nd Street | Troutdale, OR 97060-1247 | U.S.A.
> + 1 503-667-4517 (voice) | + 1 503-667-8863 (fax) | rshepard@appl-ecosys.com
> http://www.appl-ecosys.com/
>
> _______________________________________________
> PLUG mailing list
> PLUG at lists.pdxlinux.org
> http://lists.pdxlinux.org/mailman/listinfo/plug
More information about the PLUG
mailing list