rossmacarthur / sheldon

:bowtie: Fast, configurable, shell plugin manager
https://sheldon.cli.rs
Apache License 2.0
958 stars 21 forks source link

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

Closed sitiom closed 1 year ago

sitiom commented 2 years ago

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.

rossmacarthur commented 2 years ago

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

rossmacarthur commented 1 year ago

Fixed in c3f87dde3017e98845378148acc4cd2268572a7a