4

I'd like to create a custom XDG_CUSTOM_DIR directory in my home directory pointing to $HOME/Custom and assign an icon to it.

I've done:

xdg-user-dirs-update --set CUSTOM ~/Custom

So far so good... ~/.config/user-dirs.dirs has been changed acordingly.

Now: how do I assign an icon to it?

2

This is not possible as the XDG specification defines specific directory names only for certain roles (example XDG_DOCUMENTS_DIR, XDG_DOWNLOAD_DIR, or XDG_MUSIC_DIR; try man xdg-user-dirs-update to see them all). Various libraries (e.g. glib or GTK+ for GNOME) implement the spec and will perform special operations for only those directories in the spec. So custom directories are not supported.

Off course you could add support to XDG_CUSTOM_DIR in GNOME for your own use. It would require coding skills to patch and compile libraries and applications to support this additional directory. For instance in glib look to https://git.gnome.org/browse/glib/tree/gio/glocalfileinfo.c#n1591 and https://git.gnome.org/browse/glib/tree/glib/gutils.c#n1541 to see how it is handled.

1
  • So I should try to hack the way gnome (in my case) treats those directories?... Any hints on how to do that?
    – Ninguém
    Sep 13 '14 at 17:00

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.