Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Please follow the XDG Base Dir Spec #1

Open
ghost opened this issue Aug 30, 2019 · 5 comments
Open

Please follow the XDG Base Dir Spec #1

ghost opened this issue Aug 30, 2019 · 5 comments

Comments

@ghost
Copy link

ghost commented Aug 30, 2019

I've noticed this is common in the ledger ecosystem, but please don't make ~/.myappname the default location. It pollutes the home directory.

https://wiki.archlinux.org/index.php/XDG_Base_Directory

@MatthiasKauer
Copy link
Owner

Hi,
Thank you for reaching out.

What would you like the default location to be? Could you elaborate or even work on a patch?
Note that I'd rather not distinguish based on OS.

Best,
Matthias

@ghost
Copy link
Author

ghost commented Aug 31, 2019

I can work on submitting a PR sometime, but for now I'll say that it should be in "$XDG_CONFIG_HOME"/tim/config.ini or similar, which is usually ~/.config/tim/config.ini.

@MatthiasKauer
Copy link
Owner

I'm worried that "$XDG_CONFIG_HOME" is not defined on many systems.
It appears to be unset on my Linuxmint/Ubuntu 16.04 and I doubt it exists on Windows.
I'm afraid this may be a non-starter for me.

@ghost
Copy link
Author

ghost commented Sep 2, 2019

Only XDG_RUNTIME_DIR is set by default through pam_systemd. It is up to the user to explicitly define the other variables according to the specification.

https://wiki.archlinux.org/index.php/XDG_Base_Directory#Specification

$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.

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

@lhanson
Copy link

lhanson commented Sep 5, 2019

+1, the specification defines default directories so users aren't expected to explicitly set env variables if they're okay with the defaults. If they don't care, then they certainly won't care that there's one less snowflake directory in their $HOME. Many simple libraries exist to derive the correct location in a cross-platform way. Respecting users' preferences is the right thing to do.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants