Consider XDG paths for config & cache #81

Open
opened 2020-01-17 20:42:19 +00:00 by tomasino · 1 comment

If XDG_CONFIG_HOME is set, then you could use $XDG_CONFIG_HOME/linkulator/... for the config files.

If XDG_CACHE_HOME is set, then you could use $XDG_CACHE_HOME/linkulator/... for the data files.

If these environment vars don't exist you could fall back to a sane location. Note: it might be difficult to implement this safely until tree traversal is solved. Differences in users' environments could make the data locations non-standard.

If `XDG_CONFIG_HOME` is set, then you could use `$XDG_CONFIG_HOME/linkulator/...` for the config files. If `XDG_CACHE_HOME` is set, then you could use `$XDG_CACHE_HOME/linkulator/...` for the data files. If these environment vars don't exist you could fall back to a sane location. _Note_: it might be difficult to implement this safely until tree traversal is solved. Differences in users' environments could make the data locations non-standard.
sloum added the
enhancement
label 2020-01-17 21:17:00 +00:00
Collaborator

The location of the configuration files could follow the XDG base directory standard. If you like to keep the root of your home directory sparse, it can be a nice improvement.

Regarding the location of data, as noted, differences in each user's environment would make the data locations non-standard. We currently search for the data file in a specific location, but this change would allow a user to store it wherever they like. How then would each users' data files be collated?

It would be possible to make this change for the configuration files, and leave the data file where it is. Would this still be a desired outcome?

@tomasino thanks once again for the suggestions. Good food for thought.

The location of the configuration files could follow the XDG base directory standard. If you like to keep the root of your home directory sparse, it can be a nice improvement. Regarding the location of data, as noted, differences in each user's environment would make the data locations non-standard. We currently search for the data file in a specific location, but this change would allow a user to store it wherever they like. How then would each users' data files be collated? It would be possible to make this change for the configuration files, and leave the data file where it is. Would this still be a desired outcome? @tomasino thanks once again for the suggestions. Good food for thought.
Sign in to join this conversation.
No description provided.