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

Request: Is it possible to follow XDG standards? #52

Closed
khalidchawtany opened this issue Nov 24, 2015 · 17 comments
Closed

Request: Is it possible to follow XDG standards? #52

khalidchawtany opened this issue Nov 24, 2015 · 17 comments
Assignees
Milestone

Comments

@khalidchawtany
Copy link

I have a lot of dot files in my home directory ( I think we all have) that cause two problems:

  • Dot files are mixed up with other files that I work on, which makes it hard to find what I am looking for, and makes the view ugly :)
  • This clutter makes it almost impossible to track the config files that I want to save under a version control.

Create a git repository in your home directory and do a git status to get a feeling of what I mean :)

@jasonm23
Copy link
Contributor

The common solution to this is to symlink your dot files in from a version controlled folder. This has worked pretty well for me, since the 90s.

On 25 Nov 2015, at 3:50 AM, Khalid H. Ahmed notifications@github.com wrote:

I have a lot of dot files in my home directory ( I think we all have) that cause two problems:

Dot files are mixed up with other files that I work on, which makes it hard to find what I am looking for, and makes the view ugly :)
This clutter makes it almost impossible to track the config files that I want to save under a version control.
Create a git repository in your home directory and do a git status to get a feeling of what I mean :)


Reply to this email directly or view it on GitHub.

@jasonm23
Copy link
Contributor

I think the biggest problem with applying XDG to OSX apps is that it's not adopted on this platform.

~/Library/Application Support/

Is the closest approximation.

If the symlink solution really bothers you we could definitely look at either:

~/.local/... or ~/.config/...

Or how about

~/.phoenix.d/

On 25 Nov 2015, at 3:50 AM, Khalid H. Ahmed notifications@github.com wrote:

I have a lot of dot files in my home directory ( I think we all have) that cause two problems:

Dot files are mixed up with other files that I work on, which makes it hard to find what I am looking for, and makes the view ugly :)
This clutter makes it almost impossible to track the config files that I want to save under a version control.
Create a git repository in your home directory and do a git status to get a feeling of what I mean :)


Reply to this email directly or view it on GitHub.

@khalidchawtany
Copy link
Author

I am already using a symlink. However, symlinks do not solve the first part of the problem.

If I am not mistaken, according to XDG standards, the configuration files are stored under ~/.config/APP_NAME/CONFIG_FILE, where config files have a name similar to init.

@jasonm23
Copy link
Contributor

I am referring to the XDG environment vars.

IIRC they are not available by default on OS X.

We would need to look in a pre-set list of folders and so

.phoenix.d; .local; .config are all fine to use.

I will try and get a patch prepared for review tomorrow.

On 25 Nov 2015, at 11:00 AM, Khalid H. Ahmed notifications@github.com wrote:

I am already using a symlink. However, symlinks do not solve the first part of the problem.

If I am not mistaken, according to XDG standards, the configuration files are stored under ~/.config/APP_NAME/CONFIG_FILE, where config files have a name similar to init.


Reply to this email directly or view it on GitHub.

@jasonm23
Copy link
Contributor

Btw I would consider this discussion relevant

https://discuss.atom.io/t/why-pollute-with-atom/778/6

On 25 Nov 2015, at 11:00 AM, Khalid H. Ahmed notifications@github.com wrote:

I am already using a symlink. However, symlinks do not solve the first part of the problem.

If I am not mistaken, according to XDG standards, the configuration files are stored under ~/.config/APP_NAME/CONFIG_FILE, where config files have a name similar to init.


Reply to this email directly or view it on GitHub.

@jasonm23
Copy link
Contributor

to add my personal preference here, I would consider using ~/Library/Application Support a mistake.

Just because Phoenix is such a developer centric app, and really isn't destined to be a general use GUI app.

On 25 Nov 2015, at 11:00 AM, Khalid H. Ahmed notifications@github.com wrote:

I am already using a symlink. However, symlinks do not solve the first part of the problem.

If I am not mistaken, according to XDG standards, the configuration files are stored under ~/.config/APP_NAME/CONFIG_FILE, where config files have a name similar to init.


Reply to this email directly or view it on GitHub.

@khalidchawtany
Copy link
Author

👍

@kasper
Copy link
Owner

kasper commented Nov 25, 2015

XDG is not a standard on OS X and I don’t think it should. If the problem is about dot-files, why bother adding a new dot-directory which is not used globally? I’m not sure how many apps even support it.

The correct place would most definitely be ~/Library/Application Support/, but since it’s nowadays very much a hidden directory on the system, this would make it harder for some users. I’m not sure if this is worth the hassle.

@kasper
Copy link
Owner

kasper commented Nov 25, 2015

Nonetheless, if required, we should support no more than one reasonable option for this. Default to ~/.phoenix.js, but maybe support for instance ~/.config/phoenix/phoenix.js. I’m all for a configurable setup, but I don’t want to make it more confusing. After all, it’s OS X.

@khalidchawtany
Copy link
Author

@kasper adding a directory under ~/.config is not adding another dot-directory, especially if you remove the dot-config from home directory.

@kasper
Copy link
Owner

kasper commented Nov 25, 2015

@khalidchawtany Yeah, I understand this, but for some it might be. I’m okay with it being the secondary location though.

@khalidchawtany
Copy link
Author

Yep, it might be.

Thanks for this lovely app everyone 👍

@kasper
Copy link
Owner

kasper commented Nov 25, 2015

Cheers! 😄

@kasper kasper added this to the 2.0 milestone Nov 25, 2015
@kasper kasper self-assigned this Nov 25, 2015
@jasonm23
Copy link
Contributor

Agreed ~/.config and ~/.local are secondary locations.

In any event ~/.phoenix.js should override both.

As far as which one of .local or .config takes precedence, unimportant. Let's say it's .config > .local

:)

Sent from my iPhone

On 25 Nov 2015, at 8:46 PM, Kasper Hirvikoski notifications@github.com wrote:

Cheers!


Reply to this email directly or view it on GitHub.

@kasper
Copy link
Owner

kasper commented Nov 25, 2015

Ok, this is implemented. Now the following locations are valid configuration paths and the first existing file will be used.

  1. ~/.phoenix.js (default)
  2. ~/Library/Application Support/Phoenix/phoenix.js (standard OS X)
  3. ~/.config/phoenix/phoenix.js (XDG-style)

Any other location can be used by symlinking. I think this should satisfy most opinions and setups. I don’t see the need to support XDG-environment variables directly, as they are not standard on OS X.

@khalidchawtany Thanks for raising your opinion! This should solve your original problem with cluttering the home directory and make it easier to have them under version control. 😄

@kasper kasper closed this as completed Nov 25, 2015
@khalidchawtany
Copy link
Author

Great :)
thank you very much 👍

@jasonm23
Copy link
Contributor

Nice

On 26 Nov 2015, at 2:05 AM, Kasper Hirvikoski notifications@github.com wrote:

Ok, this is implemented. Now the following locations are valid configuration paths and the first existing file will be used.

~/.phoenix.js (default)
~/Library/Application Support/Phoenix/phoenix.js (standard OS X)
~/.config/phoenix/phoenix.js (XDG-style)
Any other location can be used by symlinking. I think this should satisfy most opinions and setups. I don’t see the need to support XDG-environment variables directly, as they are not standard on OS X.

@khalidchawtany Thanks for raising your opinion! This should solve your original problem with cluttering the home directory and make it easier to have them under version control.


Reply to this email directly or view it on GitHub.

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

No branches or pull requests

3 participants