Helion-Engine / Helion

A modern fast paced Doom FPS engine
GNU General Public License v3.0
86 stars 9 forks source link

Updated default config path for Linux #536

Closed Omnisthetics closed 9 months ago

Omnisthetics commented 9 months ago

Updated the default config path for Linux to comply with the XDG Base Directory Specification which is to save config files using $XDG_CONFIG_HOME and, if empty or not set, fallback to $HOME/.config.

If neither environment variables are usable, the config is saved to the current directory.

nstlaurent commented 9 months ago

Will this load the config file from the current directory for those already have it there? I think it would need something like: const string IniFile = "config.ini"; if (File.Exists(IniFile)) return IniFile;

Omnisthetics commented 9 months ago

No, it will not but that's the point. In most cases, Linux applications are installed via package managers into directories the user doesn't have direct write access to, so best practice is to prioritise managing user data in their home directory, regardless of whether the app is portable or installed via a package manager. For full context, I plan on making an AUR package for Helion.

It'll be a bit annoying initially for those running Helion on Linux but its easy enough use the -config arg or even just move their config file to $HOME/.config/helion and never worry about it again.