New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FreeDesktop spec for user folder should be respected on Linux #4392

Open
pcercuei opened this Issue Aug 11, 2018 · 4 comments

Comments

Projects
None yet
4 participants
@pcercuei
Contributor

pcercuei commented Aug 11, 2018

Observed behaviour

Pioneer saves to ~/.pioneer

Expected behaviour

Pioneer saves to $XDG_DATA_HOME/pioneer if that variable is set, else ~/.local/share/pioneer

Steps to reproduce

My pioneer version (and OS):

git master on Debian GNU/Linux

@johnbartholomew

This comment has been minimized.

Contributor

johnbartholomew commented Aug 19, 2018

It's actually a little more complicated than that, because the XDG spec separates different types of user data:

  • config files in $XDG_CONFIG_HOME
  • "data" files in $XDG_DATA_HOME
  • cache files in $XDG_CACHE_HOME

And lookups for data and config are supposed to look in multiple directories as controlled by $XDG_CONFIG_DIRS and $XDG_DATA_DIRS.

I don't think we have any cache type files (we used to; some model data got processed and cached IIRC). We certainly have config. We also have:

  • log files
  • save files -- is that config?
  • mods -- that's almost certainly data
  • screenshots -- config?

Migrating existing users... eh, probably the best thing to do there is to check for the existence of ~/.pioneer/ and add it to the necessary search paths, but only write to the new directories. Maybe write a CONFIG_FILES_HAVE_MOVED file into ~/.pioneer/ if it exists, if we're feeling fancy.

Or easier just ignore ~/.pioneer/ completely, only use the new dirs, and accept that people will have to do some manual file moves. Document it somewhere.

@impaktor

This comment has been minimized.

Member

impaktor commented Aug 19, 2018

Migrating existing users... eh, probably the best thing to do there is to check for the existence of ~/.pioneer/ and add it to the necessary search paths, but only write to the new directories.

Sounds like the best option, if we're to do this switch.

Or easier just ignore ~/.pioneer/ completely, only use the new dirs, and accept that people will have to do some manual file moves.

That sounds like it will cause some chaos in the player base. If we even have one?

Document it somewhere.

I imagine most people don't read documentation

@pcercuei

This comment has been minimized.

Contributor

pcercuei commented Aug 19, 2018

I think config.ini and imgui.ini should go to ${XDG_CONFIG_HOME}/pioneer; the other files (mods, savestates) should go to ${XDG_DATA_HOME}/pioneer.

Note that due to confinement, the Flatpak-packaged Pioneer won't be able to see the current savestates anyway, so it's a perfect timing for the change.

Maybe we can move the folder with some light scripting? In the top-level "pioneer" script for instance, when Pioneer is built from the source.

@shmerl

This comment has been minimized.

shmerl commented Nov 23, 2018

Separation of config and data while formally is specified, isn't really useful in case of games. It's a royal pain to move that over if you migrate your installation. So putting it in one location like $XDG_DATA_HOME is perfectly fine and you don't need to pedantically split it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment