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

Follow XDG basedir specification #2749

Closed
Lucki opened this Issue Oct 22, 2017 · 7 comments

Comments

Projects
None yet
4 participants
@Lucki

Lucki commented Oct 22, 2017

Right now a new folder for configurations and userdata is created in $HOME/.unknown-horizons.
To be more flexible it would be nice to implement the XDG Base Directory Specification.

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

An easy explanation can be found in the gnome wiki.

This would result in the following folders:

  • $XDG_CONFIG_HOME/unknown-horizons/<SETTINGS.XML> defaulting to $HOME/.config/unknown-horizons/<SETTINGS.XML> when $XDG_CONFIG_HOME is not set or empty.
  • $XDG_DATA_HOME/unknown-horizons/<LOG|MAPS|SAVE|SCREENSHOTS> defaulting to $HOME/.local/share/unknown-horizons/<LOG|MAPS|SAVE|SCREENSHOTS> when $XDG_DATA_HOME is not set or empty.
  • $XDG_CACHE_HOME/unknown-horizons/<YAMLDATA.CACHE> defaulting to $HOME/.cache/unknown-horizons/<YAMLDATA.CACHE> when $XDG_CACHE_HOME is not set or empty.

Advantages are:

  • No predefined paths. The user can decide where his or her data is located.
  • No cluttered home directory. Some selectors will automatically show dotfiles, finding the files you want will be easier.
  • A shared storage location for data. Application data does not have to be searched for, as these are no longer located in different places. This also benefits a backup.
  • Resetting the settings and keeping the application data at the same time becomes easier, as there is a clear separation.

@LinuxDonald LinuxDonald added this to the 2017.3 milestone Oct 22, 2017

@LinuxDonald

This comment has been minimized.

Show comment
Hide comment
@LinuxDonald

LinuxDonald Oct 22, 2017

Member

We hope we can do this for the next release.

Member

LinuxDonald commented Oct 22, 2017

We hope we can do this for the next release.

@jmdejong

This comment has been minimized.

Show comment
Hide comment
@jmdejong

jmdejong Apr 24, 2018

Contributor

Seems easy enough to fix this, but what should the default folders be on windows?
Something like the suggestions from this stackoverflow question?

Also, this will make users unable to find back earlier saves.
Should there be some kind of migration check?
If these folders are empty but the $HOME/.unknown-horizons directory exists, should it automatically move/copy user data?

Contributor

jmdejong commented Apr 24, 2018

Seems easy enough to fix this, but what should the default folders be on windows?
Something like the suggestions from this stackoverflow question?

Also, this will make users unable to find back earlier saves.
Should there be some kind of migration check?
If these folders are empty but the $HOME/.unknown-horizons directory exists, should it automatically move/copy user data?

@AndyMender

This comment has been minimized.

Show comment
Hide comment
@AndyMender

AndyMender Apr 24, 2018

Member

"Yes" to both of the last questions. If you want to use XDG, "$HOME/.unknown-horizons" should be a fallback directory with a notice to the user that it will be deprecated in the next release (whenever that is...).

Member

AndyMender commented Apr 24, 2018

"Yes" to both of the last questions. If you want to use XDG, "$HOME/.unknown-horizons" should be a fallback directory with a notice to the user that it will be deprecated in the next release (whenever that is...).

@jmdejong

This comment has been minimized.

Show comment
Hide comment
@jmdejong

jmdejong May 3, 2018

Contributor

@AndyMender What kind of notice do you mean? A popup when starting UH? A readme.txt file in "$HOME/.unknown-horizons"?

Contributor

jmdejong commented May 3, 2018

@AndyMender What kind of notice do you mean? A popup when starting UH? A readme.txt file in "$HOME/.unknown-horizons"?

@AndyMender

This comment has been minimized.

Show comment
Hide comment
@AndyMender

AndyMender May 5, 2018

Member

Either a small Tk popup window or a print() to the terminal or both.

Member

AndyMender commented May 5, 2018

Either a small Tk popup window or a print() to the terminal or both.

@jmdejong

This comment has been minimized.

Show comment
Hide comment
@jmdejong

jmdejong May 6, 2018

Contributor

How about using symlinks instead for older installs? Something like ln -S $HOME/.unknown-horizons $XDG_DATA_HOME/unknown-horizons/ (and similar for config)
I believe we don't need a message for cache migration by the way.

Contributor

jmdejong commented May 6, 2018

How about using symlinks instead for older installs? Something like ln -S $HOME/.unknown-horizons $XDG_DATA_HOME/unknown-horizons/ (and similar for config)
I believe we don't need a message for cache migration by the way.

@LinuxDonald

This comment has been minimized.

Show comment
Hide comment
@LinuxDonald

LinuxDonald May 6, 2018

Member

We can put an note into the Changelog. That UH uses than an new home folder.

Member

LinuxDonald commented May 6, 2018

We can put an note into the Changelog. That UH uses than an new home folder.

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