Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ubuntu System Tray in Python

How do I put a program in the system tray (I don't think it's called like that in Linux) in python TKINTER for UBUNTU 9.04.

like image 332
Diego Castro Avatar asked Mar 08 '10 09:03

Diego Castro


3 Answers

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

like image 78
codeape Avatar answered Nov 13 '22 21:11

codeape


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

like image 33
dieki Avatar answered Nov 13 '22 22:11

dieki


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.

like image 3
mikerobi Avatar answered Nov 13 '22 21:11

mikerobi