[Further-devel] battery meter

From: Simon Batistoni (simon@penseroso.com)
Date: Sat Jan 19 2002 - 11:33:43 PST

Having installed further on my laptop on Thursday, I was immediately
taken with how shiny it is. :)

The only thing I was really missing was a battery meter, a
particular necessity on my laptop because it can't gracefully
suspend when power gets low and I'm running X (I have an Nvidia
GeForce 2Go chip, and whilst they've now open-sourced the drivers,
no-one's made it work with apm yet :( )

So I had a bit of a fiddle around, and came up with what seems to be
a passable battery meter. By default, it sits a little way below the
cpu meters, and looks pretty much the same.

You can find a tarball at:


The apm-querying routines are rewritten from the ones in the
gnome-applets battery meter, and are slightly tricksy, to get around
making too many disk queries to get the status of /proc/apm. It did
die on me once, but I think that was due to an over-zealous
error-trapping routine which I've now zapped.

Still, it's only been running for a few hours on my Dell Inspiron
8100, and my housemate Tom Insam's IBM Thinkpad, so wider more
extensive testing would be appreciated.

You'll obviously need to add lines to your further rc to make this
work. Mine currently read:


plugin battery = "battery/battery.so" val battery.x = 0 val battery.y = 0 color battery.usercolor = 100, 100, 100, 255 val battery.barwidth = 100 val battery.barheight = 10 ----

You'll likely get a warning when you compile, concerning the add_image routine, which is part of my ongoing hacking (I want to replace the text ac on/offline with some natty little pngs).

This is my first ever piece of production c code, so be kind but fair to it :)

Simon Batistoni simon@penseroso.com

_______________________________________________ Further-devel mailing list Further-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/further-devel

This archive was generated by hypermail 2.1.4 : Tue May 28 2002 - 23:37:04 PDT