Provide a cascaded merge-overwrite config approach for #6

gamemoded will now load and merge settings from the following locations - arrays will merge and single settings will overwrite.

	1. /usr/share/gamemode/
	2. /etc/
	3. $XDG_CONFIG_HOME or $HOME/.config/
	4. $PWD
This commit is contained in:
Marc Di Luzio
2018-05-01 15:42:54 +01:00
parent ebe41657ff
commit 8bd9587e80
3 changed files with 79 additions and 25 deletions

View File

@@ -74,7 +74,20 @@ Or, distribute \fBlibgamemodeauto.so\fR and either link with \fB\-lgamemodeauto\
.SH CONFIG
\fBgamemoded\fR can be configured with a \fBgamemode.ini\fR file found in \fB/usr/share/gamemode/\fR. The daemon will load the config file on start-up if it exists.
\fBgamemoded\fR will load and merge \fBgamemode.ini\fR config files from these directories in the following order:
.RS 4
/usr/share/gamemode/
.RE
.RS 4
/etc/
.RE
.RS 4
$XDG_CONFIG_HOME or $HOME/.config/
.RE
.RS 4
$PWD
.RE
Behaviour of the config file can be explained by presenting a commented example: