antfs-cli icon indicating copy to clipboard operation
antfs-cli copied to clipboard

Download files to $XDG_DATA_HOME, not $XDG_CONFIG_HOME

Open pwithnall opened this issue 6 years ago • 2 comments

As per the XDG Base Directory specification, the data files downloaded from a device should be stored below $XDG_DATA_HOME (i.e. ~/.local/share) rather than below $XDG_CONFIG_HOME (~/.config).

The idea behind the specification is that someone could rm -rf ~/.config and still have a working system (albeit using the default configuration rather than any user-specific tweaks), but without losing any of their data. Running logs would count as user data.

Actually, it’s a bit more nuanced than this. The scripts and logs directories, and the downloaded .fit files, should be below $XDG_DATA_HOME. The per-device profile_version and authfile should potentially be below $XDG_CONFIG_HOME, but that’s more arguable either way.

pwithnall avatar Dec 13 '18 23:12 pwithnall

Yeah, I agree, perhaps the scripts should be under the config section as well? I'd happily accept a pull request for this since it probably will be a while until I can look at it.

Tigge avatar Dec 14 '18 06:12 Tigge

Yeah, I agree, perhaps the scripts should be under the config section as well?

I think they should be under $XDG_DATA_HOME (i.e. ~/.local/share), since they could be user-written, and are code rather than configuration. Theoretically they should be under ~/.local/lib/antfs-cli, but there is no $XDG_LIB_HOME variable in the specification, so $XDG_DATA_HOME will do.

I’ll try and put a pull request together at some point, but don’t block on me doing that if you get there first.

pwithnall avatar Jan 17 '19 10:01 pwithnall