~/.local/share/pixmaps is not in search list for icons

Rodrigo Silva linux at rodrigosilva.com
Wed Apr 18 23:53:56 PDT 2012


The subject is a heads up for my issue, and here's the full story:

I'm making a script that will install Eclipse IDE from the binary archives
downloaded from http://www.eclipse.org/downloads/. Eclipse is quite a
standalone, self-contained IDE (provided you have a java vm) that you can
untar the archive to any folder (say ~/eclipse) and run directly from
there. No install required at all.

Still, my install script tries to set appropriate .desktop file entry,
icon, symlink to executable, etc, in a more "proper", XDG-compliant way.
It also allows system-wide and user-only installs. So, the basic steps
regarding locations are:

For system-wide install:
- extract to /opt/eclipse
- symlink /opt/eclipse/eclipse executable to /usr/bin/eclipse
- create a desktop entry in /usr/share/applications/eclipse.desktop
- copy the provided icon in /opt/eclipse/icon.xpm to /usr/share/pixmaps/eclipse.xpm

Works great, while trying its best to conform to standard XDG locations.
(and yes, I'm using the XDG_DATA* vars, not hardcoding paths)

For user install:
- extract to ~/.local/opt/eclipse
- symlink ~/.local/opt/eclipse/eclipse executable to ~/bin/eclipse
- create a desktop entry in ~/.local/share/applications/eclipse.desktop
- copy the provided icon to... ?

See the problem? The obvious place would be ~/.local/share/pixmaps/eclipse.xpm,
but that folder is not in search list for icons. For the user I must use
~/.local/share/icons/hicolor/48x48/apps. So my issues are:

- There's no "symmetry" in system-wide and per-user locations regarding icons,
so I must use /usr/share/icons/.. tree for a xpm icon instead of its "natural"
place at /usr/share/pixmaps

- Or I could hardcode ~/.local/share/pixmaps/eclipse.xpm in it's .desktop file,
which is not a recommended practice

So, what should I do? Why the Icon Spec does not define ~/.local/share/pixmaps
for the user, just /usr/share/pixmaps ? Are pixmaps a legacy dir, and only
present in system path for backward-compability?

if so, is it ok to place xpm icons in the /usr/share/icons... tree? Should I
completely disregard /usr/share/pixmaps? Or should I not care about "symmetry"?

What is the best approach to follow? Any background info is highly appreciated

Thanks,
Rodrigo



More information about the xdg mailing list