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 am working on a package for a custom application and cannot get my applications icons to display. Here is my desktop file, which is installed in /usr/share/applications:

[Desktop Entry]
Version=1.0
Type=Application
Name=Map Creator
Icon=ntfmo-map-creator
TryExec=/opt/ntfmo/map_creator/bin/map_creator
Exec=/opt/ntfmo/map_creator/bin/map_creator.sh
Categories=Office;
X-Desktop-File-Install-Version=0.16

I have copied images to the following locations:

  • /usr/share/icons/hicolor/32x32/apps/ntfmo-map-creator.png
  • /usr/share/icons/hicolor/48x48/apps/ntfmo-map-creator.png
  • /usr/share/icons/hicolor/scalable/apps/ntfmo-map-creator.svg

I have rebooted, but still nothing. Do you have to register the icons or something?

[EDIT] Ok, I got it to work by running sudo rm -f /usr/share/icons/*/icon-theme.cache, but that seems a little draconian. Is that the "correct" solution? Does my package need to run that after it installs? Seems a little much....

share|improve this question
1  
I think you are supposed to call gtk-update-icon-cache as per manpages.ubuntu.com/manpages/natty/man1/… –  fossfreedom Oct 4 '11 at 19:15

1 Answer 1

up vote 9 down vote accepted

Add gtk-update-icon-cache /usr/share/icons/hicolor to your debian/postinst file:

#!/bin/sh

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

exit 0
share|improve this answer
    
OK, thanks, this is working. Although I also noticed that ubuntu automatically updates the cache when icons are added as part of a package, but not when you manually drop them in. –  Dave Oct 5 '11 at 12:35

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.