xdg-user-dirs – purpose?

Simon McVittie smcv at collabora.com
Thu Nov 9 15:43:22 UTC 2017


I would suggest looking at how major graphical environments like GNOME,
Unity and KDE use these directories. The examples I give here are from
GNOME because that's the one I'm most familiar with, but I think KDE has
similar behaviour.

On Thu, 09 Nov 2017 at 15:10:18 +0100, Thomas U. Grüttmüller wrote:
>            DESKTOP
> 
> *Some* file managers display this folder in the root window. Others, e.g.
> ROX, don’t.

Environments that want to display a folder as if it was the root
window[1], like Windows does (e.g. GNOME 2 and its various forks) should
use this one. Not all environments want that UX (e.g. the designers of
both GNOME 3 and Unity chose to leave the desktop empty); the environments
that don't have the concept of file icons on the desktop have no special
use for this folder. It would not be appropriate for freedesktop.org to
try to force graphical environments to put icons on the desktop if they
have chosen not to.

>            DOWNLOAD
> 
> This folder is a dump where the web browser will put all sorts of downloaded
> files. After a short time there will be total chaos. :-(

In some browsers it's the default location to download/save files. In
browsers that just save the file without prompting for a location, it's
the only location. It isn't freedesktop.org's place to make that sort of
UX decision for browsers: if you don't like how a particular browser
operates, talk to its authors.

In GNOME it's also the target for Bluetooth file transfers.

>            PUBLICSHARE
> 
> This looks interesting. Has it ever been implemented? It reminds me of the
> public_html folder found in older distributions.

Yes, GNOME can export it via WebDAV (the Sharing panel in the System
Settings, which controls gnome-user-share). I think it was also
available read-only via Bluetooth in the past, although I can't find
an option for that now.

>            DOCUMENTS
> 
> The purpose is not obvious. Gimp uses it as a default to save pictures; Anki
> uses it to store its configuration files…

It's the equivalent of Windows' "My Documents" folder, used as a
default/suggested location for files saved by the user in content-creation
applications ("office" apps, and more specialized editors like GIMP or
Inkscape). From what you've said here, I think GIMP is using it correctly,
and Anki is not - configuration files are usually implicitly created
by using or reconfiguring an application rather than being explicitly
saved by the user, so they should go in the XDG_CONFIG_HOME defined by
the XDG basedir spec (which by default is hidden, so the user doesn't
normally see files in their file browser that they didn't choose to
create).

>            MUSIC
>            PICTURES
>            VIDEOS
> 
> No program seems to use these folders. Their purpose is not obvious to me.

Many media players default to looking in MUSIC and/or VIDEOS, as
appropriate for the content type(s) they play. Photo management
apps like GNOME's Shotwell normally look in PICTURES, and GNOME also
saves screenshots there by default.

    smcv

[1] Technically it's a full-screen window layered above the root window,
    at least in the implementation in GNOME's Nautilus (and I think
    probably all others)


More information about the xdg mailing list