phoboslab / wipeout-rewrite

2.61k stars 203 forks source link

xdg compliance in linux #47

Closed pirate486743186 closed 10 months ago

pirate486743186 commented 11 months ago

it would be nice to follow the linux user folders standard.

the xdg standard https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html

In short:

$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.

$XDG_CACHE_HOME defines the base directory relative to which user-specific non-essential data files should be stored. If $XDG_CACHE_HOME is either not set or empty, a default equal to $HOME/.cache should be used.

here, you only care about config

phoboslab commented 10 months ago

Related PR: https://github.com/phoboslab/wipeout-rewrite/pull/10 – though SDL_GetPrefPath doesn't seem to honor $XDG_CONFIG_HOME (yet). I don't think I want to go down this road and figure out the correct save path on each platform by myself. SDL_GetPrefPath() seems to be "good enough".

samueldr commented 10 months ago

It uses DATA_HOME rather than CONFIG_HOME.

For things like save games, it should be the preferred location.

Though there is always a bit of an ambiguity with those paths and not moving files all over the place.