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

XDG Base Directory Support #203

Closed
ghost opened this issue Jul 23, 2019 · 8 comments · May be fixed by #204
Closed

XDG Base Directory Support #203

ghost opened this issue Jul 23, 2019 · 8 comments · May be fixed by #204

Comments

@ghost
Copy link

ghost commented Jul 23, 2019

Could support of XDG Base Directories be considered? It would be nice to be freedesktop.org compliant and use XDG base directories by default. I know that this has been suggested before but nothing came of it. So instead of placing a hidden file directly in the home directory, placing it in $XDG_CONFIG_HOME/slack-term.json which is usually ~/.config/slack-term.json. This prevents home directory pollution which I personally can't stand.

@jrwrigh
Copy link

jrwrigh commented Sep 3, 2019

I was about to write an issue for this exact thing. It should probably still check $HOME/ for backwards compatibility sake. Unfortunately, I don't know Go so I can't fix the issue in a reasonable amount of time.

For anyone wanting to take a stab at it, it looks like all that would need to be changed is simply put some logic at the function on line 55-60 of main.go.

Simply a "check $XDG_CONFIG_HOME/, $HOME/.config/, and $HOME for slack-term.json,in that order" is all that'd be necessary from what I can see.

Edit: updated logic to the full XDG spec per @
BilLOPGVkPPn8z0JGJhgiAGNo9YAqpk5ruChl0F's comment

Edit2: Also, reminder to whoever does it to update the README.md to reflect the change.

@jrwrigh
Copy link

jrwrigh commented Sep 3, 2019

Also, repeat of #170 (though without the exact XDG terminology).

@ghost
Copy link
Author

ghost commented Sep 3, 2019

Note that the specification specifies that $XDG_CONFIG_HOME must be checked before falling back to $HOME/.config, before falling back to how it is now. Although I've never heard of anyone not setting XDG_CONFIG_HOME to $HOME/.config.

@ghost
Copy link
Author

ghost commented Sep 3, 2019

@jrwrigh
Copy link

jrwrigh commented Sep 3, 2019

Gotcha. I updated my comment in case anyone finds this and just reads my comment on the directories to be checked.

@lhanson
Copy link
Contributor

lhanson commented Sep 3, 2019

I'm happy to write a patch for this, but was hoping to get some confirmation from @erroneousboat that this would be a feature which they'd merge. I've encountered the odd maintainer who is either recalcitrant to adhere to the XDG spec or is simply unresponsive and the PR just sits in limbo forever. Not saying that's the case here, but it's nice to ask first before expending the effort when I've got a list of other projects I use which could use the same attention.

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.
@lhanson
Copy link
Contributor

lhanson commented Sep 5, 2019

Patch submitted, ambitious users can run my branch if they don't want to wait for it to be merged.

Looking at the commit history and the number of dormant PRs open, it seems like this project isn't actively maintained or is only given sporadic attention. If @erroneousboat wants some help maintaining the project I'm sure some community members would be interested in having a more up-to-date repo! I don't even use Slack that much anymore but would be willing to help.

@jpbruinsslot
Copy link
Owner

Closing this in favour of #170

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 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.
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

Successfully merging a pull request may close this issue.

3 participants