rossmacarthur/sheldon

Sheldon should follow XDG Base Directory spec even if environment variables are not defined

sitiom opened this issue · 2 comments

From https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html:

$XDG_DATA_HOME defines the base directory relative to which user-specific data files should be stored. If $XDG_DATA_HOME is either not set or empty, a default equal to $HOME/.local/share should be used.

$XDG_CONFIG_HOME defines the base directory relative to which user-specific configuration files should be stored. If $XDG_CONFIG_HOME is either not set or empty, a default equal to $HOME/.config should be used.

Most apps respect and follow this behavior, so sheldon should default to $HOME/.local/share/sheldon and $HOME/.config/sheldon. Perhaps the best way to have forward compatibility with this change is to detect both the xdg directories and ~/.sheldon but give a warning when ~/.sheldon is loaded.

I agree it would be better to respect XDG and people can always override this by setting SHELDON_CONFIG_DIR and SHELDON_DATA_DIR.

Fixed in c3f87dd