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

Configuration file path #170

Closed
abacao opened this issue Nov 19, 2018 · 9 comments · May be fixed by #204
Closed

Configuration file path #170

abacao opened this issue Nov 19, 2018 · 9 comments · May be fixed by #204
Assignees

Comments

@abacao
Copy link

abacao commented Nov 19, 2018

Please consider looking the configuration file not only in ~ but also in ~/.config/slack-term/config (or even change it to this path)

https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html

https://unix.stackexchange.com/questions/312988/understanding-home-configuration-file-locations-config-and-local-sha

@jpbruinsslot jpbruinsslot self-assigned this Nov 20, 2018
@jpbruinsslot jpbruinsslot added this to the v0.4.2 milestone Nov 20, 2018
@lhanson
Copy link
Contributor

lhanson commented May 16, 2019

@erroneousboat Is this a feature you'd merge if a PR was submitted?

@jrwrigh
Copy link

jrwrigh commented Sep 3, 2019

@lhanson The logic to do it is pretty simple from what I can tell (I admittedly have no idea what I'm doing in Go). See my first comment in #203 for the specific function that (probably) needs to be changed.

@lhanson
Copy link
Contributor

lhanson commented Sep 3, 2019

@jrwrigh Excellent, thanks for that info.

lhanson added a commit to lhanson/slack-term that referenced this issue Sep 5, 2019
Rather than assuming a configuration file at `~/.slack-term`, respect
the user's choice per the XDG Base Directory specification
(https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html)
to find the configuration.

Uses a cross-platform XDG library to abstract the details of the
specification and encompass any future changes
(https://github.com/OpenPeeDeeP/xdg, https://godoc.org/github.com/OpenPeeDeeP/xdg).

After merging, the [wiki home page](https://github.com/erroneousboat/slack-term/wiki)
should be updated to reflect the new configuration location.

This closes jpbruinsslot#170 and closes jpbruinsslot#203.
@jpbruinsslot
Copy link
Owner

Reference #203

@jpbruinsslot
Copy link
Owner

Ok, at the moment I don't see the merit of using XDG Base Directories other that a "clean" home directory. I'll have a look at the links provided here, but seeing from the PR needing to have additional knowledge of XDG Base Directory Specification, and explicitly setting it doesn't really seem that of an improvement. I'd rather have it as is, with the option to specify from the command line where the config file is.

@lhanson
Copy link
Contributor

lhanson commented Sep 10, 2019

Please do at least skim the spec and/or some of the justifications for it to understand why this is a win for everybody. Implementing the spec costs nothing from either a user's or a maintainer's perspective, and has many benefits.

needing to have additional knowledge of XDG Base Directory Specification, and explicitly setting it doesn't really seem that of an improvement

There is no assumption that users have ever heard of the specification, and no requirement for them to explicitly configure anything. The specification provides sensible defaults for the case where the variables aren't set, which will be most of the time. Users who don't know what the spec is will have their files stored in reasonable locations (and may come away with the experience that Linux[0] is fairly consistent and predictable, rather than the common impression upon new users that it's chaotic and hard to make sense of). Users who are aware of the spec and are fine with the defaults won't have to set anything. People with special use cases where they want to specify particular paths (a small minority of users) can set the environment variables accordingly. Without following the spec, none of those users would likely guess that $HOME/.slack-term is the magic config path without being told anyway.

As for tangible benefits, here are a couple off the top of my head:

  • Users can back up or version control all of their configurations from a single directory subtree. Sync $XDG_CONFIG_HOME and you're done. Contrast that with having to maintain a list of snowflake directories for each application which doesn't follow the spec, likely with regexen and exceptions in cases where an application doesn't use distinct directories for configuration vs. data vs. cache.
  • Users can rely on the fact that data in $XDG_CACHE_HOME can safely be deleted to free up space, or in some privacy-sensitive applications (VPN users in repressive countries) they may want to explicitly do so after every session anyway.

[0] Or, in this case, whatever OS they're using. One reason that the OpenPeeDeeP/xdg module used in the PR is much nicer than most XDG implementations is that it handles cross-platform directory standards transparently for you, so whether the user is on Linux, Mac, Windows, etc., the right kind of files end up in the expected locations for them and the program author doesn't need to worry about specifics.

@jpbruinsslot
Copy link
Owner

Alright, thanks I'll have a look

@jpbruinsslot jpbruinsslot modified the milestones: v0.4.2, v0.5.0 Sep 21, 2019
jpbruinsslot added a commit that referenced this issue Sep 28, 2019
@abacao abacao closed this as completed Oct 3, 2019
@jpbruinsslot
Copy link
Owner

Reopening issue, not yet merged.

@jpbruinsslot jpbruinsslot reopened this Oct 5, 2019
jpbruinsslot pushed a commit that referenced this issue Jan 8, 2020
Rather than assuming a configuration file at `~/.slack-term`, respect
the user's choice per the XDG Base Directory specification
(https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html)
to find the configuration.

Uses a cross-platform XDG library to abstract the details of the
specification and encompass any future changes
(https://github.com/OpenPeeDeeP/xdg, https://godoc.org/github.com/OpenPeeDeeP/xdg).

After merging, the [wiki home page](https://github.com/erroneousboat/slack-term/wiki)
should be updated to reflect the new configuration location.

This closes #170 and closes #203.
jpbruinsslot added a commit that referenced this issue Jan 8, 2020
jpbruinsslot added a commit that referenced this issue Jan 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants