Skip to content
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 #175

Open
Lucki opened this issue Oct 22, 2017 · 0 comments
Open

Follow XDG basedir specification #175

Lucki opened this issue Oct 22, 2017 · 0 comments

Comments

@Lucki
Copy link

@Lucki Lucki commented Oct 22, 2017

Right now a new folder for configurations and userdata is created in $HOME/.megaglest.
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/megaglest/<GLESTUSER.INI|GLESTUSERKEYS.INI> defaulting to $HOME/.config/megaglest/<GLESTUSER.INI|GLESTUSERKEYS.INI> when $XDG_CONFIG_HOME is not set or empty.
  • $XDG_DATA_HOME/megaglest/<MAPS|SAVED|SCENARIOS|SCREENS|TECHS|TILESETS|TUTORIALS|DEBUGWORLD.LOG|GLEST.LOG> defaulting to $HOME/.local/share/megaglest/<MAPS|SAVED|SCENARIOS|SCREENS|TECHS|TILESETS|TUTORIALS|DEBUGWORLD.LOG|GLEST.LOG> when $XDG_DATA_HOME is not set or empty.
  • $XDG_CACHE_HOME/megaglest/<CACHE|TEMP> defaulting to $HOME/.cache/megaglest/<CACHE|TEMP> 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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants