zulip-terminal icon indicating copy to clipboard operation
zulip-terminal copied to clipboard

Improve zuliprc location/specifying (eg. dot-file or .config/)

Open alfonsrv opened this issue 5 years ago • 7 comments

Following the configuration of other terminal-configuration files, the default zuliprc file should be called .zuliprc without having to explicitly specify it using the -c switch.

alfonsrv avatar Jun 08 '20 10:06 alfonsrv

or ~/.config/zulip/zuliprc

Jellby avatar Jul 10 '20 14:07 Jellby

This was discussed on chat.zulip.org in #backend>storing client settings in May, among other aspects.

From my perspective a dotfile would be good, but standardizing on ~/.config/zulip/zuliprc would be better (or a good addition).

Aspects to consider: (possibly to update later)

  • Should we support both .zuliprc and the xdg path? Which takes priority?
  • What name should we use within .config? We should check with the main project.
  • We could use the (tiny) xdg library to handle the ~/.config aspect, though it's python3.6+ (we use 3.5+ currently)
  • We should probably separate zuliprc files and one config file, to allow updating the connection details and config separately

neiljp avatar Jul 12 '20 05:07 neiljp

Another benefit of some kind of .zuliprc/ rather than a simpler file approach, is that this provides a namespace that ZT can use, including treating the filenames (or names without eg. a .zuliprc extension) as names for each server connection.

Since py3.5 is now EOL, this opens up the use of xdg after we migrate to py3.6.

neiljp avatar Nov 03 '20 19:11 neiljp

@neiljp I too think ~/.config/zulip/zuliprc would be better approach than having a .zuliprc, mainly because having just one sub-directory instead of a number of dot files(for different profiles) and/or dot directories will reduce clutter when "hidden" files are displayed in GUI, and ofcourse pushing all user-configuration files to a dedicated sub-directory is always an attractive solution. :)

  • Thus, I believe supporting just the xdg path would be better, because of the above reason. Having a .zuliprc/ directory would still mean one extra clutter in the home directory?
  • I am not completely sure what do you mean by "main project"(zulip/zulip maybe?), but we could use ~/.config/zulip-term/zuliprc, hinting the name of the PyPi package that we currently go with?
  • Since v3.5 is probably EOL, their shouldn't be any issue with any of these points.
  • We could place all the config details in ~/.config/zulip-term/<config-file> this would be common for all organizations. And, all the user-profile for organizations could be placed in .zuliprc/ as you said, but deciding a specific name format should be the main challenge in my opinion. :)

zee-bit avatar Mar 27 '21 09:03 zee-bit

@zee-bit See #961 for my general thoughts on this, which should clarify some of these points.

Re checking with the main project, I meant what namespace we should use under .config - zulip? zulip-terminal? This could tie in with improving the server/webapp approach to saving/naming zuliprc files, potentially - but for now we would need to rely on users saving/naming them appropriately, unless we generate them.

There is potentially quite a lot of scope for organizing these settings better, particularly where multiple sessions are involved, and we'd need this independently of #961.

I'd expect an end result could now look something like

$XDG_CONFIG_HOME/zulip/
  org1.zuliprc
  org2.zuliprc
  czo.zuliprc
  zulip-term.conf

with the config from zulip-term.conf being able to be replaced by specifics in org1.zuliprc. We'd retain backwards compatbility via zulip-term -c some_zuliprc (which would pick up defaults from zulip-term.conf), but also have a positional input enabling zulip-term czo or zulip-term org1.

Those names are of course subject to discussion :)

neiljp avatar Mar 28 '21 22:03 neiljp

yes, please follow XDG properly :)

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

xeruf avatar Sep 15 '22 10:09 xeruf