Linux config directory should follow XDG Base Directory Specification

Ideas, that are too old (too much things changed) or won't be implemented cause of some reasons or if there are obvious better suggestions.

Moderator: ickputzdirwech

Post Reply
User avatar
YoshiRulz
Manual Inserter
Manual Inserter
Posts: 1
Joined: Mon Aug 05, 2019 12:10 pm
Contact:

Linux config directory should follow XDG Base Directory Specification

Post 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).

User avatar
Klonan
Factorio Staff
Factorio Staff
Posts: 4935
Joined: Sun Jan 11, 2015 2:09 pm
Contact:

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

Post by Klonan »

I will move this to ideas and suggestions

tehfreek
Filter Inserter
Filter Inserter
Posts: 391
Joined: Thu Mar 17, 2016 7:34 am
Contact:

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

Post by tehfreek »

+1. I don't particularly hate having it at ~/.factorio, but it's probably time to modernize.

Fwiffo
Burner Inserter
Burner Inserter
Posts: 5
Joined: Thu Dec 31, 2020 5:17 pm
Contact:

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

Post 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.

Rseding91
Factorio Staff
Factorio Staff
Posts: 11923
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Linux config directory should follow XDG Base Directory Specification

Post 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
If you want to get ahold of me I'm almost always on Discord.

Fwiffo
Burner Inserter
Burner Inserter
Posts: 5
Joined: Thu Dec 31, 2020 5:17 pm
Contact:

Re: Linux config directory should follow XDG Base Directory Specification

Post 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.

Post Reply

Return to “Outdated/Not implemented”