Add support for user defined local script plugins

A much requested feature, this allows for providing custom scripts in the config file. An example in the man page is below and would trigger both a system notification, and allow control over a background crypto mining script automatically in gamemode.

	[custom]
	; Custom scripts (executed using the shell) when gamemode starts and ends
	start=notify-send "GameMode started"
	    /home/me/bin/stop_ethmining.sh

	end=notify-send "GameMode ended"
	    /home/me/bin/start_ethmining.sh

	Scripts are run with system() and do not have any special privilages, as with the rest of the daemon, custom scripts that require root will need their own permissions set up externally.

	This commit also renames two defines as they needed to be moved to the public interface.
This commit is contained in:
Marc Di Luzio
2018-04-24 16:52:53 +01:00
parent c45b9f90a4
commit db8a70b7ba
5 changed files with 109 additions and 21 deletions

View File

@@ -86,6 +86,14 @@ reaper_freq=10
; Gamemode will always reject anything in the blacklist
blacklist=HalfLife3
glxgears
[custom]
; Custom scripts (executed using the shell) when gamemode starts and ends
start=notify-send "GameMode started"
/home/me/bin/stop_ethmining.sh
end=notify-send "GameMode ended"
/home/me/bin/start_ethmining.sh
.fi
.RE