webmacs icon indicating copy to clipboard operation
webmacs copied to clipboard

Make config file placement adhere to the XDG Base Directory Specification

Open xantoz opened this issue 5 years ago • 2 comments

I'd like to avoid having another .directory cluttering up my home folder if possible. The XDG Base Directory Specification says that config directories and the like should reside under ${XDG_CONFIG_HOME:-$HOME/.config} (read as sh script).

What this would mean for webmacs is that the config directory is $XDG_CONFIG_HOME/.config/webmacs when XDG_CONFIG_HOME is defined and ~/.config/webmacs when not defined.

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

P.S. Reading the specification further I realize this probably means the ~/.webmacs/profiles directory should live under ${XDG_DATA_HOME:-$HOME/.local/share}/webmacs/profiles as well. D.S.

xantoz avatar Nov 17 '18 12:11 xantoz

Thanks for reporting this (and sorry for the delay). I think it's a good idea and a requirement to adhere to standards. To not make that change a hard breaking change, here is what I can think of:

  1. add a check to move config to the new directories automatically. (and remove that check in some versions)
  2. or, add a deprecation warning to indicate how / where to move the configuration - but still use the configuration (and remove that in some versions)

I'm more in favor of 2.

It would be nice to:

  • show current path in some web page, say webmacs://config or something. Or maybe in webmacs://version.
  • would be nice to add the possibility to configure the config dir from the command line. And the profiles directory.

@xantoz , what do you think?

parkouss avatar Dec 29 '18 17:12 parkouss

@parkouss Sounds good to me. It doesn't even have to be complicated. First look in .webmacs, if it's there use that + maybe emit deprecation warning. If it's not there check ~/.config/webmacs

xantoz avatar Jan 07 '19 14:01 xantoz