xdg-rs / dirs

a low-level library that provides config/cache/data paths, following the respective conventions on Linux, macOS and Windows
186 stars 23 forks source link

XDG user dirs should default to `$HOME` #56

Open OJFord opened 2 years ago

OJFord commented 2 years ago

If ${XDG_CONFIG_HOME:-$HOME/.config}/user-dirs.dirs does not exist, or lacks the specified key (e.g. XDG_DOWNLOAD_DIR), the behaviour of xdg-user-dir the CLI program is to output $HOME.

In the same case, the behaviour of dirs_next::download_dir() (for example) is to return None.

There's no specification as such for '"well known" user directories', but it's implied that this is the intended fall-back behaviour:

Note: To disable a directory, point it to the homedir.

https://www.freedesktop.org/wiki/Software/xdg-user-dirs/

cf. tauri-apps/tauri#3090