Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have written a python application (with pygtk and pymozembed) which I use very often.

In the Unity dash my application has an icon (as I definded in the .desktop file). But when I start it, there is no icon in the launcher. Just an empty hole.

Launcher file: /home/witek/.local/share/applications/kadro-reader.desktop

[Desktop Entry]
Name=Google Reader
Comment=Open site with Kadro: reader -> https://www.google.com/reader/view/
Icon=/home/witek/.kadro/sites/reader/icon.png
Exec=/home/witek/.kadro/sites/reader/start.sh
Categories=Network;
Type=Application

Python code for window initialization:

win = gtk.Window()
win.set_title("Google Reader")
win.set_icon_from_file("/home/witek/.kadro/sites/reader/icon.png")

How to add an Unity launcher icon to my pyhton application?

share|improve this question
1  
is your icon a png or svg? Where did you install it? Did you run gtk-update-icon-cache after installing your icon? –  Timo Kluck Dec 6 '11 at 15:48
    
I have edited my question to add my concrete example. –  Witek Dec 8 '11 at 14:35
    
Are you making a site-specific browser? Cuz I want that. –  Ken Feb 16 '12 at 3:39
    
I use it for sites like Facebook or Google which try to track me. That way I have a specific browser for these sites and my default browser is not logged in into these services. You can download it here: github.com/witek/kadro/downloads –  Witek Feb 21 '12 at 14:52

2 Answers 2

up vote 2 down vote accepted
+50

I don't think icon in .desktop file takes full path. I think it takes the name of an icon and searches for that icon in the current icon theme.

Try to put that icon at "~/.icons/google-reader.png" and in the .desktop file just put

Icon=google-reader
share|improve this answer

I have got I think a better answer. As the described solution add the icon application to the Dash Unity panel, it fails to display the icon on the application itself in /usr/share/applications

You only need to add the icon (with the name declared in the Desktop Entry) in the /usr/share/pixmaps/ directory. This is the directory where all applications put their icons. This way you get your icon displaying in Dash Unity and on the application in the applications folder.

Besides the one currently checked is working, it requires you to create a new folder in your Home directory. This is not necessary if you use the /usr/share/pixmaps directory.

share|improve this answer
    
My application creates launchers (by the user) which are user specific. Therefor they have to be in the users home. The user also has no permissions to write into /usr/share/pixmaps. –  Witek Feb 21 '12 at 14:49

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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