Battray
What is Battray ¶
Battray is a python program that displays a tray icon to inform you of
the battery status of your notebook. It is also able to take certain actions
depending on battery status.
I searched for a simple and easy application which did exactly that, all I
found were large applications which need a ton of dependencies, or applications
that didn’t work for me.
Screenshots ¶
Here are two screenshots of Battray 1.2 being used with pekwm and stalonetray.
Download ¶
Latest version:
22 October 2009 – battray-1.2.tar.gz
Previous versions:
6 September 2009 – battray-1.1.tar.gz
16 August 2009 – battray-1.0.tar.gz
Fast start ¶
Extract the files, move battrayrc.py.example to ~/.battray/battrayrc.py, and run battray.py.
The usual way to start it is putting it in your ~/.xinitrc or ~/.xsession, i.e.:
xsetroot -grey ~/bin/battray.py & exec twm
For more documentation, see the manpage: battray(1)
Requirements ¶
- Python
– Tested with version 2.5. - PyGTK 2.10
or newer.
Since every OS has slightly different ways of getting the battery status, each one will have to be configured. See the platforms/ folder for a list of supported OS’s. At the moment we have OpenBSD and FreeBSD. I know this is not a lot, but these are the only two (desktop) operating systems I use…
Changelog ¶
v1.2 (20091022) ¶
- New configuration file syntax, which is much more flexible.
- Add simple Makefile for easier installation & deinstallation.
- Add manpage.
- As usual various minor improvements
v1.1 (20090906) ¶
- Battery icon is now green/yellow/red depending on battery life remaining.
- Battray will now warn you if battery level is below a certain percentage (See warn and warnMethod options in config.py).
- Reload configuration on SIGHUP.
- Added instructions on how to add platform.
- Add new icon to indicate error (Instead of no icon loaded at all).
- Fix FreeBSD platform, thanks to Eponasoft @ FreeBSD forums for reporting & testing.
- Some improvements on the OpenBSD platform.
v1.0 (20090816) ¶
- Initial release.
Notes ¶
Keep in mind that Battray was and is mainly written for personal purposes, which means that features I use have high priority, and other features I don’t use have a low priority. This doesn’t mean I won’t accept patches and/or will try my best to help people out if they have a problem.
To do ¶
Add more platforms (Linux, Windows, and MacOS mainly).
Better icons (battery.png and ac.png are OK now, but charging.png and error.png are pretty ugly IMO).
Bugs
The configuration could be a bit easier, the fact that it's imported in Python makes configuration pretty flexible, but also makes it more difficult for non-python programmers.
Also note that if you have a battrayrc.py file in the same path as battray or battray.py then python will import that file, as far as Python is concerned this is not a bug but a feature, but due to my (mis)use of import it is a bug.
Multiple batteries are not supported.
Authors ¶
Martin Tournoij <carpetsmoker@rwxrwxrwx.net>
Battray is licensed under the <INSERT OSI APPROVED LICENSE OF CHOICE HERE> license.