Installing icons manually by copying files to /usr/share/icons/hicolor/256x256/apps/My256pxSquareIcon.png and using

sudo xdg-icon-ressource install --theme hicolor --context apps --novendor --mode system --size 256 ./My256pxSquareIcon.png My256pxSquareIcon doesn't result in the same thing.

The second allow to just use Icon=My256pxSquareIcon inside a .desktop file and allow the dynamic use of different resolutions icons when available to best suit the situation while the first require to use the full path of the icon.

What is xdg-icon-ressource doing in addition to copying the file to the icon path to allow this ?


It touches a file in the installation directory to change the directory mtime. Gtk+, for example, checks to see icon directories are updated or not in gtkicontheme.c::rescan_themes().

So, to emulate xdg-icon-ressource in your example, just do the following:

$ sudo touch /usr/share/icons/hicolor/

You can make sure that the directory's mtime is changed with stat before and after touch.

$ stat /usr/share/icons/hicolor/
  File: /usr/share/icons/hicolor
  Size: 4096        Blocks: 8          IO Block: 4096   directory
Device: 10302h/66306d   Inode: 27002061    Links: 19
Access: (0755/drwxr-xr-x)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2018-08-27 19:01:50.000000000 +0900
Modify: 2018-08-27 19:01:50.000000000 +0900
Change: 2018-08-27 19:01:50.437962154 +0900
 Birth: -

Check the line starting with "Modify:".

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.