Tigge / antfs-cli

Extracts FIT files from ANT-FS based sport watches such as Garmin Forerunner 60, 405CX, 310XT, 610 and 910XT.
MIT License
312 stars 77 forks source link

Download files to $XDG_DATA_HOME, not $XDG_CONFIG_HOME #177

Open pwithnall opened 5 years ago

pwithnall commented 5 years ago

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.

Tigge commented 5 years ago

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.

pwithnall commented 5 years ago

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.