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 #6630

Closed
DorpsGek opened this issue Oct 22, 2017 · 3 comments
Closed

Follow XDG basedir specification #6630

DorpsGek opened this issue Oct 22, 2017 · 3 comments
Labels
flyspray This issue is imported from FlySpray (https://bugs.openttd.org/)

Comments

@DorpsGek
Copy link
Member

Lucki opened the ticket and wrote:

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.

[2]: https://wiki.gnome.org/Initiatives/GnomeGoals/XDGConfigFolders# Guidelines

Reported version: other
Operating system: Linux


This issue was imported from FlySpray: https://bugs.openttd.org/task/6630
@DorpsGek
Copy link
Member Author

frosch wrote:

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.


This comment was imported from FlySpray: https://bugs.openttd.org/task/6630#comment14786

@DorpsGek
Copy link
Member Author

frosch closed the ticket.

Reason for closing: Implemented

3 years ago


This comment was imported from FlySpray: https://bugs.openttd.org/task/6630

@DorpsGek
Copy link
Member Author

Lucki wrote:

Thanks for your answer!
Seems to be a packaging issue :)


This comment was imported from FlySpray: https://bugs.openttd.org/task/6630#comment14787

@DorpsGek DorpsGek added Core flyspray This issue is imported from FlySpray (https://bugs.openttd.org/) labels Apr 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
flyspray This issue is imported from FlySpray (https://bugs.openttd.org/)
Projects
None yet
Development

No branches or pull requests

1 participant