1

There is an blog article on ubuntu developer blog. http://developer.ubuntu.com/2012/02/how-to-prepare-a-compiled-application-for-ubuntu-software-center/

I followed all steps exactly. But the application seems to have no icon when I search it in the dash. The dash displays only blank white icon.

I am using Ubuntu 12.04

dobey
  • 41,650
vrcmr
  • 6,397

2 Answers2

3

The Icon field in the .desktop file, and the file name of the icon file itself, must match. As per the Icon Naming Specification, the name should be the same as the application's executable program. It should also be installed in the appropriate sizes, in the appropriate hicolor icon theme directory, as per the Icon Theme Specification.

It seems there is a typo in the page you link to, which says to name the icon as desktop.png instead of dungeon.png, and it also only talks about installing the single icon, and in the wrong place. This should be considered a bug in the site itself.

If the icons are in the correct place, and still not showing up, it is likely you need to update the icon cache for theme. You can run sudo gtk-update-icon-cache -f /usr/share/icons/hicolor to update the system hicolor theme directory cache, for example.

dobey
  • 41,650
2

To properly install an icon for an application use xdg-icon-resource. The image files must be one of the types: PNG, XPM, or SVG, and the extension must be ".png", ".xpm", or ".svg" (lower case). If a corresponding .icon file exists in the same location as icon-file it will be installed as well.

For .svg files

xdg-icon-resource install --novendor </location/of/your/icon.svg> <icon_name>.

For .png and .xpm files

xdg-desktop-icon install --size <16, 22, 32, 48, 64, 128, or 256> </location/of/your/icon.png> <a_name_you_want>.

The default icon size launchers and menus use is 48.

Other sources of info: http://portland.freedesktop.org/xdg-utils-1.0beta1/xdg-icon-resource.html http://standards.freedesktop.org/icon-theme-spec/icon-theme-spec-latest.html