elinks icon indicating copy to clipboard operation
elinks copied to clipboard

XDG base directory compliance

Open toastal opened this issue 2 years ago • 10 comments

The perennial issue, XDG base directory compliance would split up $HOME/.elinks and move these files into the standard directories for most distros.

More info:

  • https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html
  • https://wiki.archlinux.org/title/XDG_Base_Directory

toastal avatar Dec 23 '22 04:12 toastal

For now, files are written and read from ~/.config/elinks/ It is up to user to move/copy files there. Location of global configuration was not touched.

rkd77 avatar Dec 26 '22 16:12 rkd77

Wow, so elinks no longer reads files in ~/.elinks/, seriously? It should at least try both, old if exists, and new if not. This has been the directory for like 20 years or something! XDG is some GUI spec anyways from "freedesktop" which invented a bunch of crap nobody needs. Just my opinion!

smemsh avatar Jan 02 '23 00:01 smemsh

A unified method of organizing config files in a noncluttered way in the $HOME isn’t “crap” and it's also what most people have come to expect in the last 10 years.

toastal avatar Jan 02 '23 02:01 toastal

Users could have done ELINKS_CONFDIR=$XDG_CONFIG_DIR in their profile easily enough. Even if we wanted to say we're changing the default location to follow the "desktop spec," it cannot even be overridden with the now-removed $ELINKS_CONFDIR. Changing $XDG_CONFIG_DIR would change it for all other applications which use it. The only option is a symlink, and it will surprise upgrading users to need to create it, as well as any that already moved it somewhere else with $ELINKS_CONFDIR.

I suggest the following precedence order:

(1) use $ELINKS_CONFDIR if set (2) use ~/.elinks if it exists (3) use $XDG_CONFIG_DIR if set

this satisfies everyone, doesn't surprise any long-time users, and allows them to change at their own pace/will.

smemsh avatar Apr 13 '23 03:04 smemsh

If ELINKS_CONFDIR is set, to use it makes sense. Do you know anybody who has set ELINKS_CONFDIR? But (2), no. Users can copy files to ~/.config/elinks . It takes a few seconds.

rkd77 avatar Apr 13 '23 12:04 rkd77

I moved ~/.elinks to ~/.config/elinks, but after starting elinks, it didn't read the config/bookmarks/etc.. feom rather, and it rather created a new ~/.elinks dir

aelmahmoudy avatar Apr 27 '23 06:04 aelmahmoudy

@aelmahmoudy it works for me. It is possible that you mix old elinks (0.16) with 0.17.GIT. Also possible that some scripts (from browser scripting), have hardcoded old location of bookmarks, etc.

rkd77 avatar Apr 27 '23 07:04 rkd77

I am using elinks 0.16.0 tarball from the tags page.

I checked 'src/config/home.c', I don't find any code checking for xdg-config-home, yet in the master git branch, that code exists.

aelmahmoudy avatar Apr 29 '23 04:04 aelmahmoudy

XDG will come in 0.17. I'm going to release 0.16.1 on Sunday.

rkd77 avatar Apr 29 '23 06:04 rkd77

Don't see the value in forcing all users to migrate, even if only "a few seconds." Cost of also supporting the old location was essentially free.

Nonetheless, thanks for keeping $ELINKS_CONFDIR; I prefer that workaround rather than a symlink.

smemsh avatar Mar 05 '24 00:03 smemsh