goatcorp / FFXIVQuickLauncher

Custom launcher for FFXIV
https://goatcorp.github.io/
GNU General Public License v3.0
2.85k stars 333 forks source link

[Linux] XIVLauncher Core should honor the XDG Base Directory Specification #1029

Open Maia-Everett opened 2 years ago

Maia-Everett commented 2 years ago

Update disclaimer

What happened, what did not, what did you want to happen?

At a bare minimum, XIVLauncher Core should use $XDG_DATA_HOME/xlcore ($HOME/.local/share/xlcore by default) for its user data files, instead of $HOME/.xlcore.

Additionally, it would be good if configuration files in particular were moved to $XDG_CONFIG_HOME/xlcore ($HOME/.config/xlcore by default).

For more details, see https://specifications.freedesktop.org/basedir-spec/basedir-spec-0.6.html.

Version

Native/Core version (Linux)

Platform

Linux (native)

philpax commented 2 years ago

fyi @goatcorp/unix

Zi-SH commented 2 years ago

This is a change that I'm currently working on. Much like other *nix users, I hate having my $HOME littered with app directories.

That being said, there is still a bit of an internal debate as to how far XDG specification should be implemented. At the very least I would say:

Config is a bit more iffy as the patch would break everything. I'd like to implement $XDG_CONFIG_HOME, and that discussion can be had when the PR is ready. I'll tag the PR in here when I add it.

marzent commented 2 years ago

Strictly speaking logs should be in $XDG_CACHE_HOME as well and the Dalamud config file will should also be in $XDG_CONFIG_HOME just like the launcher and game config or all of this will lead to inconsistencies and user confusion due to config and log file fragmentation.

This would require a change to Dalamud itself since the config (and log file) paths are currently hardcoded at https://github.com/goatcorp/Dalamud/blob/387a8203928a261ee7c82026e993ba193fdbf44e/Dalamud.Injector/EntryPoint.cs#L168

Also migrating from the old to the new structure is something that would have to be implemented and tested throughly. Splitting up everything like that would require a refactor of core XL components that would likely have to be tested as well to not have a negative impact on the WPF version.

IMO it is best to either:

Dormanil commented 2 years ago

Considering we want it to be easy to find the logs, I find it already concerning that the Dalamud logs are just farted into $HOME/.xlcore, when there's a logs folder in the same directory. We should definitely fix that, and if we're already moving the Dalamud and Dalamud-Injector logs, then we might as well put them into XDG_STATE_HOME. I don't particularly care about the game patches landing in XDG_CACHE_HOME, but Dalamud assets, runtime, plugins, wineprefix, and the game should absolutely end up in XDG_DATA_HOME, and configs (xlcore, game, Dalamud, and all plugin configs) should land in XDG_CONFIG_HOME.

I furthermore suggest that there's buttons in XLCore's UI for opening the relevant folders for less linux-savvy users so that we can still easily tell those users where they can find the logs to share to us, or where to delete Dalamud.

(Though, to be fair, whenever I am supposed to look for logs on any linux-native thing, my first instinct still remains pouring through journalctl.)

Figuera commented 2 years ago

I created a fork of this project and moved all the configuration files to $XDG_CONFIG_HOME/xlcore. I would create a pull request but my changes are very minimal and not fully XDG compliant. You can find my fork here: https://github.com/Figuera/FFXIVQuickLauncher.

I agree that a more serious effort to follow XDG specifications would be nice. But I wouldn't complain if a temporary solution (like mine) would be implemented in order to remove that undesirable folder from our HOME directories.