0

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.

closed as off-topic by RPiAwesomeness, goldilocks, lenik, syb0rg, Impulss Apr 9 '14 at 5:32

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "This question does not appear to be specific to the Raspberry Pi within the scope defined in the help center." – RPiAwesomeness, goldilocks, lenik, syb0rg, Impulss
If this question can be reworded to fit the rules in the help center, please edit the question.

  • Launching on startup is something you have to do from outside this program. – ExploWare Mar 22 '14 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. – RPiAwesomeness Mar 22 '14 at 16:02
0

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 – rjdunwoody91 Mar 23 '14 at 11:09

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