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

Add support for XDG Base Directories ($XDG_CONFIG_HOME) #31

Open
mfederczuk opened this issue Feb 11, 2023 · 1 comment
Open

Add support for XDG Base Directories ($XDG_CONFIG_HOME) #31

mfederczuk opened this issue Feb 11, 2023 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@mfederczuk
Copy link

Currently, the global config file is hardcoded at ~/.texterify.json, which is undesirable because it is yet another config file that clutters up the home directory.
This becomes even worse when using the global config names feature (~/.texterify.json, ~/.texterify.json.serverA, ~/.texterify.json.serverB, …).

Most modern systems have a dedicated ~/.config directory to put these kind of config files, and the XDG Base Directory Specification defines the XDG_CONFIG_HOME environment variable (defaults to $HOME/.config), which lets users customize the location their config files.

I propose switching from using the current, hardcoded location to using the XDG_CONFIG_HOME environment variable. The final location of the global config file would be something like $XDG_CONFIG_HOME/texterify/config.json, with global config names being located in the same directory and with the filenames config.json.{global_config_name}.
The legacy ~/.texterify.json and ~/.texterify.json.{global_config_name} locations may be used as fallbacks for backwards compatibility.

@chrztoph
Copy link
Member

Thanks for your feedback, I think it should not be a big deal to first search in the XDG_CONFIG_HOME folder and as a fallback check the home directory for the configuration files.

@chrztoph chrztoph added the enhancement New feature or request label Feb 22, 2023
@chrztoph chrztoph self-assigned this Feb 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants