blobbyvolley2 icon indicating copy to clipboard operation
blobbyvolley2 copied to clipboard

Support XDG directory specificiation

Open TomaszGasior opened this issue 5 years ago • 9 comments

The game should save settings in proper directory, defined by XDG specification, instead of just ~/.blobby, by default it should be ~/.config/blobby for example.

Please take a look at:

  • https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html
  • https://wiki.archlinux.org/index.php/XDG_Base_Directory

TomaszGasior avatar Oct 22 '20 20:10 TomaszGasior

Should we set our write-directory to PHYSFS_getPrefDir()? This would put things in .local/share/blobby.

Also, while we are at it, we probably want to change things so that we are writing to this directory also in a windows installation.

ngc92 avatar Dec 29 '22 11:12 ngc92

You are right. We should use PHYSFS_getPrefDir(). It does the right thing. On linux it takes XDG_DATA_HOME also into account.

Added a first PR for discussion.

danielknobe avatar Dec 29 '22 19:12 danielknobe

Please keep backward compatibility for users who already have Blobby Volley installed. The app should check whether the directory exists in legacy path and then execute one of the following:

  • just use the legacy path forever if it exists;
  • move files from legacy path to current path and remove old directory.

TomaszGasior avatar Jan 02 '23 20:01 TomaszGasior

Also, according to XDG directories standard there should be separation between data and config. Configuration files (window size, game settings, preferences) should be stored somewhere in $XDG_CONFIG_HOME (defaults to ~/.config). From the other hand, data files like game scripts, highscores, backgrounds should be stored in $XDG_DATA_HOME (defaults to ~/.local/share).

TomaszGasior avatar Jan 02 '23 20:01 TomaszGasior

imho backward compatibility is not important in this case.

Following the spec we should separate config and data that's right. Physfs may support this in the future (https://github.com/icculus/physfs/issues/41). If Physfs supports this, we will also get this separation for other systems.

danielknobe avatar Jan 06 '23 20:01 danielknobe

imho backward compatibility is not important in this case.

This may be bad user experience when user loses configuration, replays, input settings right after game update. Typical end user don't have to understand what's going on with config directories so it would be good idea to avoid this kind of experience.

TomaszGasior avatar Jan 06 '23 20:01 TomaszGasior

Hi, I prepared pull request for Flatpak package to update the game to new version: https://github.com/flathub/de.blobbyvolley.BlobbyVolley2/pull/4

I noticed that new version supports XDG config directories but does not migrate data from legacy ~/.blobby. After upgrade the user loses all customizations. It this intentional?

Currently I am not going to merge my pull request so Flatpak users still get old version.

TomaszGasior avatar Jul 25 '23 19:07 TomaszGasior

Hi this looks great. Thank you very much.

There are no plans to migrate the settings from the old folder. Maybe you can wait with your merge until version 1.1.1 is released, because there are critical bugs in 1.1 .

danielknobe avatar Jul 25 '23 20:07 danielknobe

I will do what you prefer. However, it would be nice if you would use GitHub "releases" instead of just bare git tags so I will get notification from GitHub when new release will be available.

TomaszGasior avatar Jul 25 '23 21:07 TomaszGasior