Gemba / skyscraper

Powerful and versatile game data scraper written in Qt and C++.
https://gemba.github.io/skyscraper/
GNU General Public License v3.0
54 stars 14 forks source link

[Enhancement] Follow XDG Base Directory Specification on Linux systems #70

Open ASHGOLDOFFICIAL opened 5 months ago

ASHGOLDOFFICIAL commented 5 months ago

Benefits Specification is widely adopted. It allows to clean home directory by moving configs/cache/etc to specified locations. Another benefit is separation of configuration files, cache and data files. By moving ./cache/ folder and other files/folders that are not supposed to be modified by user to another location, you can ensure they will not be modified by user.

Possible way to implement It's only a draft. File/folder Possible XDG location
./cache/ XDG_CACHE_HOME or XDG_DATA_HOME
./resources/ XDG_DATA_HOME
./config.ini, ./artwork.xml and examples XDG_CONFIG_HOME
./reports, skipped-* XDG_STATE_HOME
./import/ and other files XDG_DATA_HOME

To remain backwards compatible, add config option like xdg. When this option is enabled, and XDG* variables are set, they will be used. If XDG* variables aren't set either fallback to ~/.config/, ~/.local/state or ~/.cache (preferred) or use current ~/.skyscraper.

Useful resources

Gemba commented 3 months ago

I see it as a compile switch/define: A user starts either the current way or uses XDG. I don't like the idea to have it as configuration switch. There might be migration scripts to move exiting config files et.al. from one location to the other and vice-versa.

Gemba commented 2 weeks ago

@ASHGOLDOFFICIAL , @retrobit, @gbiggs it is merged into main/HEAD . Please do also test on your side and report any issues here. Documentation: https://gemba.github.io/skyscraper/XDG/