Page 1 of 1

Linux config directory should follow XDG Base Directory Specification

Posted: Mon Aug 05, 2019 12:38 pm
by YoshiRulz
Not a bug per se, but it'd be greatly appreciated if the path was calculated from env vars as per the XDG Base Directory spec (my other Steam games use ~/.local/share/<game> i.e. $XDG_DATA_HOME).

Re: [0.17.62] Linux config dir is $HOME/.factorio

Posted: Mon Aug 05, 2019 12:39 pm
by Klonan
I will move this to ideas and suggestions

Re: [0.17.62] Linux config dir is $HOME/.factorio

Posted: Mon Aug 05, 2019 1:30 pm
by tehfreek
+1. I don't particularly hate having it at ~/.factorio, but it's probably time to modernize.

Re: [0.17.62] Linux config dir is $HOME/.factorio

Posted: Sat Jan 09, 2021 4:09 pm
by Fwiffo
:+1: since this should get rid of part 1 of 2 of my patch (part 2 is a bit more exotic) :-)

Backwards compatibility could be achieved by simply checking whether $HOME/.factorio exists and if that's not the case, use the XDG directories.

Re: Linux config directory should follow XDG Base Directory Specification

Posted: Tue Jan 12, 2021 1:06 am
by Rseding91
You can just set the folder the game uses through the config.ini file and config-path.cfg file. https://wiki.factorio.com/Application_directory

Re: Linux config directory should follow XDG Base Directory Specification

Posted: Tue Jan 12, 2021 2:07 am
by Fwiffo
Rseding91 wrote:
Tue Jan 12, 2021 1:06 am
You can just set the folder the game uses through the config.ini file and config-path.cfg file. https://wiki.factorio.com/Application_directory
That's not the same as the mechanism in 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.
With the path config, you can only set one of these variants, but in order to correctly handle the fallback you need to add an additional wrapper (or well, patch the binary itself, like mentioned above) which handles that logic.