This project is considered stable PyPI

Battray is a simple tray icon to show your laptop’s battery status. It’s simple, easy, fairly environment-independent, and ‘just works’ without tons of {Gnome,KDE,..} dependencies.

You can also configure it to play annoying sounds if your battery is getting low, dim the screen when you switch from AC to battery, etc.


The quickest is to install it with pip:

pip install battray

Manual instructions

Battray requires Python 3.2+ with GTK (through PyGObject). It runs on FreeBSD, OpenBSD, and Linux.


doas pkg_add py-gobject3


sudo apt-get install python3-gi

After that run ./battray.py with Python 3. You can run ./setup.py install if you like it.


The default settings should be good for most people, but Battray is pretty flexible and you can set it up as you like. The default configuration is at /usr/share/battray/battrayrc.py or /usr/local/share/battray/battrayrc.py, copy it to ~/.config/battray/battrayrc.py and edit it, there are a few comments to get you started.

The configuration file is run with exec(), so any Python code goes.

Available functions

Available variables


Version 2.3, 2017-11-07

Version 2.2, 2016-04-24

Version 2.1, 2015-11-09

Version 2.0, 2015-09-18

Version 1.5, 2012-07-11

Version 1.4, 2011-09-26

Version 1.3, 2011-07-24

Version 1.2, 2009-10-22

Version 1.1, 2009-09-06

Version 1.0, 2009-08-16

Authors and license

Battray was written by Martin Tournoij martin@arp242.net and released under the terms of the MIT license:

The MIT License (MIT)

Copyright © 2008-2017 Martin Tournoij

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

The software is provided “as is”, without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose and noninfringement. In no event shall the authors or copyright holders be liable for any claim, damages or other liability, whether in an action of contract, tort or otherwise, arising from, out of or in connection with the software or the use or other dealings in the software.

The notification sound is by Keith W. Blackwell and released under the terms of the CC BY license.

Copyright © 2010–2018 Martin Tournoij <martin@arp242.net>
This document is licensed under a cc-by 4.0 license.