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

Allow XDG_CONFIG_HOME usage also on Windows #1520

Open
1 task done
Destroy666x opened this issue Jul 20, 2023 · 0 comments
Open
1 task done

Allow XDG_CONFIG_HOME usage also on Windows #1520

Destroy666x opened this issue Jul 20, 2023 · 0 comments
Labels
enhancement New feature or enhancement new Needs triage. Comments are welcome!

Comments

@Destroy666x
Copy link

Destroy666x commented Jul 20, 2023

Checklist

  • I've searched for similar feature requests.

Enhancement request

It would be nice if Windows also supported and prioritized XDG_CONFIG_HOME env var, if set. While it's not a common standard, it can be easily set by the user and a bunch of cross-system applications support it. Examples: git, github, 0install, ... I know you can use HTTPIE_CONFIG_DIR instead, ut cluttering env vars with lots of vars for different apps isn't too tidy.


Problem it solves

It makes Windows setup a bit easier in certain scenarios, for example with configs saved on cloud, for cross-system configuration.


Additional information, screenshots, or code examples

The change should be as simple as modifying https://github.com/httpie/httpie/blob/30a6f73ec806393d897247b4c7268832de811ff7/httpie/config.py#L41 to:

        xdg_config_home_dir = os.environ.get(ENV_XDG_CONFIG_HOME)
        if xdg_config_home_dir:
            return Path(xdg_config_home_dir) / DEFAULT_CONFIG_DIRNAME
        else:
            return DEFAULT_WINDOWS_CONFIG_DIR

or anything alike, e.g. you could ensure that the subdir exists in that dir as well.

@Destroy666x Destroy666x added enhancement New feature or enhancement new Needs triage. Comments are welcome! labels Jul 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or enhancement new Needs triage. Comments are welcome!
Projects
None yet
Development

No branches or pull requests

1 participant