Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Store configuration and cache according to XDG specifications #390

Open
genodeftest opened this issue Sep 12, 2015 · 9 comments
Open

Store configuration and cache according to XDG specifications #390

genodeftest opened this issue Sep 12, 2015 · 9 comments

Comments

@genodeftest
Copy link

In the old unix days applications stored all their configuration dirs and files in hidden directories under the users home dir. These worked well enough back then, since there weren't many applications storing stuff there. Nowadays however, there's typically about a hundred files and dirs in the users homedir.
The freedesktop organization took it into their hands to change this, and wrote a specification how to handle such data which can be found at: http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html
I propose that Devassistant follows the same guidelines, to remove the clutter from users homedirs by incorporating the basedir-spec as set by the freedesktop org, which would bring the config files into .config (the default for $XDG_CONFIG_HOME) .cache for caches etc.

See also: https://wiki.gnome.org/Initiatives/GnomeGoals/XDGConfigFolders

@tradej tradej added this to the 1.0 milestone Sep 14, 2015
@tradej
Copy link
Member

tradej commented Sep 14, 2015

Hi, thanks for filing the issue. We'll have a look at it and try to incorporate it into version 1.0 that should come out in the coming months.

P. S. I am attaching the discussion tag because I am not sure what can/will be broken by this change, and I think we should properly plan this first, research, and report results in this bug.

@hroncok
Copy link
Member

hroncok commented Sep 14, 2015

I think we can safely move the cache.

@bkabrda
Copy link
Member

bkabrda commented Sep 15, 2015

@genodeftest how will this work on Mac OS or perhaps old Linuxes that don't support this? Will we have to preserve the current behaviour for these cases?

@genodeftest
Copy link
Author

The XDG specification defines fallbacks for operating systems that don't support this. See http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html#variables , e.g.:
$XDG_CONFIG_HOME defines the base directory relative to which user specific configuration files should be stored. If $XDG_CONFIG_HOME is either not set or empty, a default equal to $HOME/.config should be used.
This should work on most unix-derived OSes, including Mac and *BSD.

I think the hardest part is about the transition of moving existing configs to new paths.

@hroncok
Copy link
Member

hroncok commented Sep 16, 2015

Note: What's currently stored in ~/.devassistant is not only configuration, but mostly code (=assistants).

@tradej
Copy link
Member

tradej commented Sep 17, 2015

I suppose we can store the data in ~/.config all right—e. g. xchat2 stores logs there and more. Generally speaking, I am not opposed to the change if done properly, but I'd like to hear the thoughts of @hroncok and @bkabrda too.

@bkabrda
Copy link
Member

bkabrda commented Sep 17, 2015

I'm ok with this for purposes of cache and perhaps config files (if we have any in future). Assistants themselves should stay in ~/.devassistant IMO, since they're code, not configuration or cache.

@genodeftest
Copy link
Author

I guess assistants should be moved to $XDG_DATA_HOME which defaults to $HOME/.local/share. That is what many applications do: everything that is neither config nor cache goes to ~/.local/share.

@bkabrda
Copy link
Member

bkabrda commented Sep 17, 2015

Ok, that sounds reasonable.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants