Ubuntu – What icon does Unity use for an application

application-developmenticonsunity

I have a .deb package that installs application icons under the following locations:

/usr/share/icons/hicolor/16x16/apps/
/usr/share/icons/hicolor/48x48/apps/
/usr/share/icons/hicolor/32x32/apps/
/usr/share/pixmaps/

After I installed the .deb package and replaced the installed icons with new ones (on disk), the old icon still shows up in Unity. What icon does Unity use for the application?

Best Answer

Icons are cached in one very big file:

GTK+ can use the cache files created by gtk-update-icon-cache to avoid a lot of system call and disk seek overhead when the application starts. Since the format of the cache files allows them to be mmap()ed shared between multiple applications, the overall memory consumption is reduced as well.

Every theme should create a cache file on installation.

/usr/share/icons/[theme]/icon-theme.cache

So for example - if you remove/rename the gnome icon-cache file:

sudo mv /usr/share/icons/gnome/icon-theme.cache /usr/share/icons/gnome/icon-theme.cache.backup

You can then regenerate the cache:

sudo gtk-update-icon-cache --force /usr/share/icons/gnome

In your case, you have added your application icons to hicolor - therefore you should force the regeneration of this cache file to pick up the new icons:

sudo gtk-update-icon-cache --force /usr/share/icons/hicolor

source

Related Question