Ubuntu System Tray in Python Ubuntu System Tray in Python tkinter tkinter

Ubuntu System Tray in Python


I don't believe you can do that using Tkinter. You will have to use the gtk libraries.

An example, found on a Ubuntu forum: http://ubuntuforums.org/showpost.php?s=bc369fc9343ae728577f1bdcd292caca&p=1053546&postcount=3

Here's an example (in Perl) of combining gtk and Tk. Gtk handles the tray icon, and the rest of the app uses Tk: http://www.perlmonks.org/?node_id=626617


You have to use GTK. Do note that Ubuntu 10.04+ has a new, incompatible system tray. It's called AppIndicator; there's a python example here: https://wiki.ubuntu.com/DesktopExperienceTeam/ApplicationIndicators#Python%20version


There is the sytem tray protocol, which I believe both gnome and kde use. You might be able to use it straight from python using ctype to call X11 methods. But I would go with the GTK solution.