Home directory location for overriding icons

directory-structurehomeiconsxdg

There are a few home directory locations that complement /usr locations. Files in these locations override their /usr counterparts. For example:

  • ~/.local/bin complements /usr/bin
  • ~/.local/share/applications complements /usr/share/applications

If I want to override an application, I can create a custom .desktop file and store it in ~/.local/share/applications. This is helpful if I want to tweak how the application is invoked, but overkill if all I want to do is change the icon.

Additionally:

  • if the original .desktop file is non-trivial I either lose the original functionality or need to keep my local copy in-sync
  • I can't modify non-application icons (status icons, etc)

I could modify or maintain icons in /usr/share/icons/hicolor/48x48, but I would prefer to maintain them in my home folder, and these would be fallback icons not overriding icons.

Is there a home folder location that complements /usr/share/icons, where I could store application icons and other icons, and they would override existing theme icons?

For example, I'm using the Papirus theme but I want to use my own icon notepad.svg for the Text Editor application. This icon is defined in /usr/share/applications/org.gnome.gedit.desktop as Icon=gedit. Where should I place notepad.svg?

Best Answer

The historical equivalent is ~/.icons, the XDG equivalent is ~/.local/share/icons (strictly speaking, icons subdirectories of the paths in $XDG_DATA_DIRS). When you specify an icon by name only in a .desktop file, that relies on icon themes, so it’s worth reading the icon theme spec.

Ideally you should use xdg-icon-resource to install icons locally.

Related Question