TkBattery v1.0H by Fastjack, fastjack@fastjack.turf.org
Based on XBattery by Roland Barmettler <roli@freestone.ch>

Original source last modified 15.02.97
This source last modified on 4.7.98

TkBattery is an power status monitor for X using the kernel's Advanced Power Management (APM) BIOS interface.  The goal of v1.0H is to add functionality and lower deskspace usage of the original xbattery. 1.0H also "fixes" what I perceive to be bugs, and adds command line configuration.

TkBattery now has two modes, percentage (default) and minute display. Warning beeps are optional at 10% and each percent below that, at 2% an optional warning dialog pops up.  Desktop space has been reduced by removing the bitmaps.  Override redirect is set, for that nice focus-less, decoration-less look.

Required:
	TCL/TK (tested on 8.0, lower versions *should* work)
	APM support compiled into the kernel. (Non-modular as of 2.0.32)

TkBattery honors the following arguments in addition to the standard wish arguments (most importantly -geometry):

	-quiet : no warning dialog
	-nobeep : no warning beeps
	-bg <color> : background color (defaults to Digital CDE bgcol)
	-lbg <color> : low battery background color (defaults to red)
	-fg <color> : foreground color (default is #dddddd)
	-sleep <miliseconds> : sleep <miliseconds> before next update
		(defaults to 1 minute)
	-noinfo : no info popup window on mouseover... in case you find
		that feature annoying
	-min : minute display mode
	-gentle : The info popup sets geometry to insane values to hide a
		little flicker, if this causes a problem for you use -gentle.
		You will get a little info window flicker, however.

Event bindings:
	
	Button one click : set don't beep < 10%
	Button three click : exit
	Mouseover : info popup
	Mouseleave : destroy info popup

Notes:

	I started porting this to C, and about halfway through during a test ruun I noted that the C program actually took more RAM and CPU time than the tcl/tk version, so those of you who are resource paranoid (like myself) can forgive yourselves for using a whole interpreted for something so minor.

Errata:

	Let me know if you find anything.

Legal:

	Copyright 1998 by Chris Allen <fastjack@fastjack.turf.org>
	
	 This program is free software; you can redistribute it and/or modify
	 it under the terms of the GNU General Public License as published by
	 the Free Software Foundation; either version 2 of the License, or
	 (at your option) any later version.

	 This program is distributed in the hope that it will be useful,
	 but WITHOUT ANY WARRANTY; without even the implied warranty of
	 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	See the
	 GNU General Public License for more details.

	 You should have received a copy of the GNU General Public License
	 along with this program; if not, write to the Free Software
	 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

I think that should do it. Enjoy.
