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

support config file in XDG style #51

Closed
wants to merge 1 commit into from
Closed

support config file in XDG style #51

wants to merge 1 commit into from

Conversation

keis
Copy link

@keis keis commented Jun 19, 2014

A quick and dirty patch that tries to load the config from the xdg configured location. This is not very useful on its own but I figured the best way to open the discussion on xdg in irssi is by putting some code out there.

More on XDG Base Directory http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html

@dgl
Copy link
Member

dgl commented Jun 19, 2014

I don't really understand the rationale here, this is a standard for GUI apps. Also, given users often need to know where the Irssi directory is (e.g. to add scripts) I think adding an alternate location is just going to make it confusing. (I'm assuming a non-quick and dirty version would actually change the Irssi home directory not just the config file, because this is even more confusing).

@keis
Copy link
Author

keis commented Jun 19, 2014

HI

As you assumed I would want a full patch set to change all the directories, but I have feeling making the code is easier than making the decision.

While xdg basedir is from the freedesktop guys it's in no way a GUI only standard. I can see a few benefits it would bring. By default it unclutters the home directory by collecting things in a single config directory. It also brings great flexibility with the ENV vars and doing the github classic of a "dotfiles" repo is super easy with xdg apps as you don't have to worry about symlinking files.

I agree that you need to know where to find your config and scripts and understand people have come to know ~/.irssi as the place for that. Having two locations is messy but trying to cold turkey might be even worse.

@ahf
Copy link
Member

ahf commented Jun 19, 2014

Not too sure I am up for this. The coding style is completely off as well. Let me get back to you once I am home from holiday the 28th.

@ahf
Copy link
Member

ahf commented Jun 29, 2014

I am going to say no this for now. Thanks for the contribution, but I don't think this is of our interest right now.

@josteink
Copy link

Chipping in on the discussion here, the XDG specification is indeed used by more than just GUI apps. In my ~/.config I have at least mc & htop, which last I checked were terminal-based apps.

Currently I have the following situation:

$ ls -la $HOME | wc -l
181
$ ls -l $HOME | wc -l
50
$ ls -la $HOME/.config | wc -l
60

That is: More than 70% of the my home-folder is cluttering from dot-dirs.

Only around 30% of the apps I have config for are "good" and follows the XDG specification. irssi should strive to be one of the good citizens in this situation IMO.

@ahf
Copy link
Member

ahf commented Oct 22, 2014

I agree. I personally dislike the penis length discussion about "how many applications does X vs. Y" as the criteria for going for either X or Y.

Having our algorithm check for ~/.irssi/ first, pick that if it exists, otherwise use ~/.config/irssi/ is fine with me.

@ahf
Copy link
Member

ahf commented Oct 22, 2014

@GeertHauwaerts @jillest @dgl What do you guys think?

@ahf
Copy link
Member

ahf commented Oct 22, 2014

Your coding style requires a little bit of love though. Looks a bit messed up right now.

@keis
Copy link
Author

keis commented Oct 22, 2014

I'm happy to do the work to get the code up to snuff. it's really nothing more than a POC to discover the scope.

@ahf
Copy link
Member

ahf commented Oct 22, 2014

Sounds good. Look at the code around yours and ensure that the coding style follows that :-) We tend to use tabs for whitespace, but we are extremely inconsistent :-(

@dgl
Copy link
Member

dgl commented Oct 22, 2014

I agree that XDG makes sense however I worry implementation of it would be incredibly confusing.

For example (I haven't thought through all the aspects of this):

Currently scripts both live under ~/.irssi/scripts and ~/.irssi/scripts/autorun (although ideally a symlink to the parent), if we strictly interpret the xdg base directory spec the autorun aspect should be treated as configuration while the script itself should be treated as data.

This means scripts should go under ~/.local/share/irssi/scripts but then with symlinks under ~/.config/irssi/scripts/autorun (maybe -- maybe we switch to a different way of specifying autorun as this is a bit cumbersome).

For this particular thing that would mean changes in:

  • API to add variants on Irssi::get_irssi_dir(); (perl and C)
  • scriptassist
  • Docs

Additionally it would mean introducing a search order for scripts (and probably code to warn users if they have a script named the same thing in both ~/.local/share/irssi/scripts and ~/.irssi/scripts).

In general I don't think the cost of this is worth it. (Remember Irssi has users who are not hugely familiar with Unix and use this on a shell account; the cost of making a change and then obsoleting random tutorials on the web is very large).

@keis
Copy link
Author

keis commented Oct 22, 2014

Did a more involved experiment with data dir included (being bored at airports, yay)

I did not move the autorun as it's not completly out of line with XDG to keep it in data even the possibility of doing it with symlinks. The alternative is allowing scripts in config when doing autorun with cp which is "more wrong" imo. if it was a more config like way of doing it I agree it should be in config.

I don't think a search order sholud be needed. By @dgl suggestion to use ~/.irssi if it exists. This would mean that ~/.irssi/scripts is the only search path if ~./irssi exists. otherwise ~./.local/share/irssi/scripts is used.

@dgl
Copy link
Member

dgl commented Oct 23, 2014

Except we already have a search order for scripts ($PREFIX/share/irssi/scripts -- e.g. /usr/share/irssi/scripts -- after the local ones). So this seems like a confusing kind of special case.

I'm still not convinced the cost of this (both in designing and implementing a nice solution and supporting users using it) is worth it when the only benefit is making someone's home directory look a little bit cleaner.

@josteink
Copy link

Looking at the discussion here I would have to agree that supporting a full XDG spec, and enforcing it by default can get confusing, especially when we mix in data-directories.

So lets not do that. How about going for a simpler approach? A partial adherence to the spec if you will.

  • If a user moves his folder .irssi-folder to the area specified by XDG, that irssi will respect that, and load from there
  • If no XDG-folders are found, don't use them and keep whatever default behaviour already in place.

I think that would be a compromise which would avoid confusion for people who give a rats ass about XDG, while still giving people the option to keep their home-dirs clutter-free.

@josteink
Copy link

if we strictly interpret the xdg base directory spec the autorun aspect should be treated as configuration while the script itself should be treated as data.

Maybe this is the emacsist in me speaking, but I think that would be interpreting it too strictly.

As I see it anything which alters the client's behavior (and scripts does that) should be considered configuration.

I agree it's a hard line which has to be drawn somewhere, but I think including scripts in the config-folder adheres to the spirit of the spec without creating extra work and needless confusion.

@wsdjeg
Copy link

wsdjeg commented Jul 9, 2016

I also want irssi support $XDG_CONFIG_HOME, as you can see the differences between neovim and vim.

@ghost
Copy link

ghost commented Dec 9, 2017

Any progress on this issue yet?

@josteink
Copy link

josteink commented Dec 11, 2017

Edit: Incorrect. Withdrawn. Disregard.

@dequis
Copy link
Member

dequis commented Dec 11, 2017

@josteink in what way does it support this? I have a ~/.weechat here and googling "weechat xdg" gets me this old issue http://savannah.nongnu.org/task/?10934 which went more or less the same way as every single xdg issue in every project.

FWIW there's always irssi --home ~/whatever

@josteink
Copy link

josteink commented Dec 11, 2017

Oh. Seems you're right and I'm 100% in the wrong. My bad.,

I did type the comment out of memory, and somehow I must have mixed something up.

Consider my comment withdrawn.

dwfreed pushed a commit to dwfreed/irssi that referenced this pull request Apr 24, 2022
fix help text wrt SERVER command

(cherry picked from commit d33fd0c)
ailin-nemui added a commit that referenced this pull request Jun 11, 2022
fix help text wrt SERVER command
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 this pull request may close these issues.

None yet

6 participants