3

I'm running Gnome 3 on Fedora 25, and many of the xdg-compliant standard user directories (like "Desktop", "Downloads", "Public", etc) have a special icon when viewed in Nautilus (i.e. the Files app). These icons also change to match the active GTK Icons theme, as managed by Gnome Tweak Tool.

Is there a way to make Nautilus use such a style-sensitive icon for custom folders? I ask because I want to make a Templates folder (to use the features mentioned in this Fedora Magazine article), and I'd like Nautilus to show that folder with Gnome's default set of "Template Folder" icons, located at:

/usr/share/icons/<theme>/<size>/places/folder-templates.png

I know how to set a file/folder's icon to a specific image (discussed here for reference), but not how to set an icon to one that will follow the active GTK Icon theme.

Is there a way to do this? Or are the style-aware icons hard-coded in Gnome/Nautilus and can't be customized?

EDIT: Looks like Nautilus uses the correct, style-aware Templates icon after all. I set ~/Templates as my XDG_TEMPLATES_DIR via 'xdg-user-dirs-update --set', and now Nautilus is using the right icon for Templates. But my question still stands for folders that aren't xdg user directories.

3

Maybe it to late, but anyway.

To achieve what you asked you need to set an icon name folder-templates in metadata::custom-icon-name attribute. You can use gio to modify the folder attributes:

gio set /path/to-dir metadata::custom-icon-name "folder-templates"

Then the icon will depend from GTK Icon theme.

  • It's never too late :) Thanks for the answer! – mr_johnson22 Aug 25 '18 at 6:11

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.