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 Python application?
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 putI 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.