17

First of all, I'm not 100% positive that the main question I've written here is actually the problem, but I have a hunch that it is. I've wrote a simple Gtk# application in Mono awhile ago, and gave it a custom ICO as its icon file. Worked great.

Recently I went to change out this icon to a different one, but when I build and run the program it still shows the icon. I've made sure that I've updated every reference to the icon file to the new one, and have completely deleted the old icon off the hard drive altogether. But it still shows up in the Launcher when I run the program.

I am assuming this means that Gtk caches the icons somewhere in Ubuntu and I probably need to force that to refresh. Any advice?

22

run the following in a terminal:

sudo update-icon-caches /usr/share/icons/*
  • +1, works flawlessly on wayland. – ankostis Jun 15 at 20:51
  • Still relevant. Just fixed my app icon issue on Ubuntu 19.04. – Jamie Carl Sep 27 at 1:39
4

You need to:

  • Update the timestamp on the top-level icon directory
  • Run gtk-update-icon-cache

Note: hicolor is the default theme which app developers should use. if you're making an icon theme, refresh your icon theme's folder instead.

sudo touch /usr/share/icons/hicolor ~/.local/share/icons/hicolor
sudo gtk-update-icon-cache

See (the only documentation I can find for this): https://fedoraproject.org/wiki/Packaging:Scriptlets#Icon_Cache

2

At the terminal command prompt type:

$ unity

This will update your *.desktop icons in the Launcher.

If the problem is not the Ubuntu Launcher but the application itself take a look http://stackoverflow.com for programming resolutions.

A similar issue to this is answered at https://stackoverflow.com/questions/5315359/custom-libindicator-icon-is-not-displayed/6503807#6503807

Also look at: https://developer.gnome.org/gtk3/stable/gtk-update-icon-cache.html

  • This did not work – soapergem Jan 24 '16 at 5:54
  • @SoaperGEM The unity the issue with the actual launcher. Running unity at a command prompt will refresh the Ubuntu's Launcher Icons. My answer was directed toward a Ubuntu Launcher issue. Since it's not working it's most likely a gtk programming issue. You might get better (quicker) answers with the actual gtk programming issue at stackoverflow.com. After resolving the actual Icon display of the gtk program that is when you would run the unity command to update Ubuntu's Launcher cache. Give me 5 minutes to update my answer. – L. D. James Jan 24 '16 at 6:51
  • this answer needs a warning on it. – Ace Sep 19 '17 at 5:52
  • @Ace Can you elaborate on the warning? – L. D. James Sep 19 '17 at 7:10
  • 3
    @L.D.James , currently running unity will force close all running applications and restart unity. I lost data in my browser because of this. – Ace Sep 19 '17 at 18:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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