You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Right now a new folder for configurations and userdata is created in `$HOME/.openttd`.
To be more flexible it would be nice to implement the XDG Base Directory Specification 1.
This is partly related to #6603.
`$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 [2].
This would result in the following folders:
- `$XDG_CONFIG_HOME/openttd/<HOTKEYS.CFG|OPENTTD.CFG|WINDOWS.CFG>` defaulting to `$HOME/.config/openttd/<HOTKEYS.CFG|OPENTTD.CFG|WINDOWS.CFG>` when `$XDG_CONFIG_HOME` is not set or empty.
- `$XDG_DATA_HOME/openttd/<AI|BASESET|GAME|HS.DAT|NEWGRF|SCENARIO|SAVE|SCREENSHOT>` defaulting to `$HOME/.local/share/openttd/<AI|BASESET|GAME|HS.DAT|NEWGRF|SCENARIO|SAVE|SCREENSHOT>` when `$XDG_DATA_HOME` is not set or empty.
- `$XDG_CACHE_HOME/openttd/<CONTENT_DOWNLOAD>` defaulting to `$HOME/.cache/openttd/<CONTENT_DOWNLOAD>` when `$XDG_CACHE_HOME` is not set or empty. - I'm not sure about this one.
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.
XDG base directories are used since OpenTTD 1.4.0.
However, OpenTTD uses libxdg-basedir to support it, which is not commonly available.
If you compile yourself, make sure to install libxdg-basedir first.
The "linux generic" binaries are compiled without libxdg-basedir, and thus do not use XDG dirs.
Lucki opened the ticket and wrote:
Reported version: other
Operating system: Linux
This issue was imported from FlySpray: https://bugs.openttd.org/task/6630
The text was updated successfully, but these errors were encountered: