I have a python application which behaves in two different ways. When started without arguments, it runs in CONFIGMODE and shows a Configuration GUI (pygtk). When started with an argument it runs in APPMODE.

Then I have two Bash-Scripts (configmode and appmode) to start. One starts my app with arguments, the other without. For each script I have created a .desktop file in ~/.local/share/applications with different icons.

But even when I start appmode.desktop the Unity launcher shows the icon from configmode.desktop.

I also use Kupfer to launch applications. And when configmode is already running Kupfer also thinks that appmode is already running.

Therefore I wonder how Unity and Kupfer identify which .desktop file to use?

My goal is to see the icon from the .desktop file which I used for startup in the Unity launcher. How can I achive this?

2 Answers 2


Unity uses the BAMF Application Matching Framework. I don't know about Kupfer.


I think the problem might not be in the desktop files themselves, but in any of the following:

  • .ui file: If you're using a user interface file, you might have set the icon_name property for the main window. In such a case, I'd say that the icon in the .desktop file is not used.

  • pygtk code: Similarly to the .ui file case, you might have set the icon for the main window using gtk.Window.set_icon_name, gtk.Window.set_default_icon_name or similar.

My advice is to programmatically set the icon for the main window when the application is started using gtk.Window.set_icon_name or gtk.Window.set_default_icon_name depending on the arguments passed to the application.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .