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

Check for .togglrc file in default XDG_CONFIG_HOME if env variable is unset #331

Open
swantzter opened this issue Aug 1, 2024 · 0 comments

Comments

@swantzter
Copy link

Right now, .togglrc is only searched after in XDG_CONFIG_HOME if that environment variable is set, but according to the spec a default of $HOME/.config should be used if that environment variable is unset.

I can respect not wanting to write the file to ~/.config if it's not in use on that system, but I would prefer the following:

  1. if XDG_CONFIG_HOME is set and $XDG_CONFIG_HOME/.togglrc exists - read and write to this file
  2. if XDG_CONFIG_HOME is not set and $HOME/.config/.togglrc exists - read and write to this file
  3. if XDG_CONFIG_HOME is not set and $HOME/.config/.togglrc does not exist exists - read and write from ~/.togglrc

When determening how to create the config file for the first time I'd recommend:

  1. if XDG_CONFIG_HOME is set - create $XDG_CONFIG_HOME/.togglrc
  2. if XDG_CONFIG_HOME is not set and $HOME/.config exists - create $HOME/.config/.togglrc
  3. if XDG_CONFIG_HOME is not set and $HOME/.config/ does not exist exists - create $HOME/.togglrc
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

1 participant