-
Notifications
You must be signed in to change notification settings - Fork 97
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 macOS users to use XDG_CONFIG_HOME #78
Comments
Click does something similar for POSIX systems, although it doesn't try to infer the |
Could you set |
That looks like it'd apply that rule even when on Windows. |
Also workaround annoying `appdirs` behaviour on macOS, see ActiveState/appdirs#78
I honestly, it seems like it would be ideal if appdirs listened to Even if XDG isn't specified for macos, for almost all tools I can set (expecting it to work) In my mind, even if it doesn't make the most sense for someone to set it on windows, it at least gives everyone an opportunity to customize the config location, as opposed to unconditionally having it set to a specific location (but only on certain operating systems). And ultimately in the default case where it's not being set, you get the same existing behavior. |
I guess I can take a stab at a PR re-enabling E: #137 exists. |
#137 seems like it'd be a jarring breaking change, on new installations it'd always prefer I'm imagining def user_config_dir(appname=None, appauthor=None, version=None, roaming=False):
path = os.getenv('XDG_CONFIG_HOME')
if not path:
if system == "win32":
path = user_data_dir(appname, appauthor, None, roaming)
elif system == 'darwin':
path = os.path.expanduser('~/Library/Preferences/')
else:
path = os.path.expanduser("~/.config")
# win32's user_data_dir already appends appname
if appname and system != "win32":
path = os.path.join(path, appname)
if appname and version:
path = os.path.join(path, version)
return path Given my understanding of the reasoning for the way it is right now (XDG is only a thing for linux), then this seems ideal to me:
Probably ideally this pattern is applied to all the xdg variables, but truly config is the only one that I'd actually like to commit to a repo, and therefore the only one there's a significant incentive to fix. Happy to submit an actual PR if there's an indication it'd get merged. |
|
The code here doesn't check for XDG_CONFIG_HOME if running macOS.
So I know that XDG is technically not a thing on macOS. But it is not uncommon for people to set up a similar system, using application-specific environment variables and at some level the XDG variables to accomplish the same thing.
For example, Git saves to the XDG_CONFIG_HOME if it is set on my Macbook.
It would be rather helpful for us if you did the same. It makes it easier for me to switch from macOS to Linux, which I want to be able to do easily.
The text was updated successfully, but these errors were encountered: