Conform to XDG directory specification
See original GitHub issueI find that configuration and state data is stored in $HOME/.grip/
, including (but not limited to) in these files:
~/.grip/cache-*
Users who do not expect state data to be stored here may accidentally back it up and synchronize it across systems improperly. Configuration data are fine, but prefer storing state data somewhere in $XDG_DATA_HOME
and configuration data to $XDG_CONFIG_HOME
to conform to the freedesktop.org / XDG standard.
Reference: https://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html
$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.
$XDG_DATA_HOME defines the base directory relative to which user specific data
files should be stored. If $XDG_DATA_HOME is either not set or empty, a default
equal to $HOME/.local/share should be used.
To implement a painless migration for existing users, you can consider reading $XDG_CONFIG_HOME/grip/config.py
first, then falling back to $HOME/.grip/
. Likewise for cache data.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:6
- Comments:13 (1 by maintainers)
Top Results From Across the Web
XDG Base Directory - ArchWiki
Application Legacy Path Supported Since
ALSA ~/.asoundrc 577df36 · 1.2.3
Android Studio ~/.AndroidStudioX.X Android Studio 4.1
Anki ~/Anki , ~/Documents/Anki
Read more >XDGBaseDirectorySpecification - Debian Wiki
The XDG Base Directory Specification (XDGBDS) defines four categories of so called DotFiles and the corresponding directories in a users home ...
Read more >XDG Base Directory Specification
$XDG_RUNTIME_DIR defines the base directory relative to which user-specific non-essential runtime files and other file objects (such as sockets, ...
Read more >Is the XDG base directory specification something to care about?
Do the XDG directory specs make any sense? Is it a good idea to try to nudge developers by bug reports or pull...
Read more >T1018 Conform to XDG Base Directory Specification - GnuPG
It'd be nice if gnupg conformed to freedesktop's XDG Base Directory Specification. ... files, while ignoring large directories such as ~/.mozilla, fast and...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’d be in favor of maintaining backwards compatibility, and I do think following the XDG spec is important.
Agreed.
Sure! No problem! The important thing is to get rid of
~/.grip
.Here is the thing. I think that since we are using a single config file
settings.py
, and the other files are cache, we could try to move straight to the spec. On some projects, the idea behind supporting legacy is to not break old installs (maybe giving users a time window too, but this is less relevant than the first) and be “nicer” to new ones. You would also need to set a future task with something like “remember removing legacy code after X months/versions”. No reason to keep multiple locations available after some time.Here you need to be somewhat carefully. You can support the XDG with this like I did on my comment. But you would also change the expected behaviour if you allow this and change
cache-*
to$XDG_CACHE_HOME/grip
. I also would like to know if someone is using this for something else other than supporting the XDG (or simply getting rid of~/.grip
).Anyways, do as you wish. I really would like to help you more, but I am more busy now than I expected.