I want to create a program that runs in the system tray (in the bottom right hand corner of the screen) on Raspbian that is using LXDE. The program needs to be similar in fashion to a battery monitor icon seen on all laptops, but this program will instead be showing the level of some super capacitors.

More specifically, the following is desirable:

  • Program launches on startup, and a small icon is displayed in the system tray in the lower right hand corner of the screen. The icon cannot be just a static image since it will be displaying the level of the super capacitors.
  • User can click the icon and a small window will appear with more information.

I'm looking for general information on going about solving this problem as well as some more detailed explanations if possible.

Can anyone point me in the right direction? I'm really struggling to find answers on Google.

  • Launching on startup is something you have to do from outside this program.
    – ExploWare
    Mar 22, 2014 at 7:06
  • 1
    This might fit better on Stack Overflow or Unix & Linux as Stack Overflow is a programming related site and Unix/Linux is obviously Unix/Linux focused. Mar 22, 2014 at 16:02

1 Answer 1


You are looking for the system tray protocol of FreeDesktop (see http://standards.freedesktop.org/systemtray-spec/systemtray-spec-latest.html). You don't need to code for this protocol for yourself, toolkits like Qt or GTK will already provide simple APIs for that. A quick googling shows this little Python and GTK based project: https://github.com/lentinj/Battery-Tray/blob/master/batteryTray.py.

The important piece seems to be the gtk.statusIcon() method. Another quick search comes up with the docs for this function: http://www.pygtk.org/pygtk2reference/class-gtkstatusicon.html. And it seems to do exactly what you want: to show an icon in the system tray.

  • Thank you very much, I'm looking into all of these now so hopefully it will all go smoothly Mar 23, 2014 at 11:09

Not the answer you're looking for? Browse other questions tagged or ask your own question.