5

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?

9

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.

  • Have you tried using xdg-icon-resource? Or the appropriate subdirectory of ~/.local/share/icons? – Stephen Kitt Nov 16 '17 at 10:15
  • That’s what it’s supposed to do, yes. By default it installs in the hicolor theme. And yes, “appropriate subdirectory” is THEME/SIZE (but you should just use xdg-icon-resource). – Stephen Kitt Nov 16 '17 at 10:17
  • I've had a bash at using xdg-icon-resource but I'm not succeeding, so I've updated the question with a concrete example of an app icon replacement, I'll find time tomorrow to expand on my attempts – david.libremone Nov 16 '17 at 10:57

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.