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 ac58a59c9b
commit d26aac7147
5 changed files with 109 additions and 21 deletions

View File

@@ -93,7 +93,6 @@ clang-format -i $(find . -name '*.[ch]')
### Planned Features
* Additional mode-switch plugins
* User configuration for local mode-switch plugins
* Improved client state tracking (PID is unreliable)
* API to query if game mode is active