Topic: Laptop battery monitor script I'd like to share (with tray icon)
Hello all
I have been developing a laptop battery system tray applet for my own distro and I'd like to share it here. I am really interested in users testing this script and providing some feedback. I hope to develop a number of simple scripts that can be used on any distro and this is the first.
The link to the download, instructions and screenshots is here:
http://chameleonos.wordpress.com/projects/battmon/
The reason for creating this script is because I hate the battery monitor on LXPanel and if you are using Tint2 or any other panel, it saves you having to install Gnome-power-manager and all its deps (yes I know you could display battery in conky, but I specifically wanted a system tray icon).
Basically this is a bash/zenity script that uses acpi to check the battery status and provide a system tray icon that updates to indicate current battery levels. It will provide warnings when running on battery if the level drops below 20%, 15%, 10% and 5%. If you have pm-utils installed on your system, then you can ask the scipt to hibernate the laptop when the level reaches 5%. Obviously hibernation on Linux is a bit hit and miss.
There are a few command line parameters detailed on the site so you can control the amount of delay between battery checks or even specify an alternative icon directory (but for now you will have to use my naming scheme
).
I will say this now, that I have gone with some bespoke icons that do not match the ones on the Gnome icon specification but that provide a wider range of level indicators. During the next update I intend to add in a command line parameter so that the script will use icons from your current icon theme if you want it to.
I know that there are some awesome bash and python scripters using these forums and I'm sure that if any of you take a look at my script you'll be able to suggest much better use of code (my bash is pretty basic self taught from Googling and trial and error). If anyone want to rewrite it in Python, be my guest!
Cheers all
richjack