Add gamemode_query_status and teach gamemoded '-s'

This allows the client to query the daemon about the status of gamemode.

	Returns the following:
		 0 if gamemode is inactive
		 1 if gamemode is active
		 2 if gamemode is active and this client is registered
		-1 if the query failed

	Passing -s to gamemoded will simply query and print the current status.

	Allows for more comprehensive testing when using 'gamemoded -r' as well as more reactionary program behaviour
This commit is contained in:
Marc Di Luzio
2018-04-25 14:39:05 +01:00
parent 966c207a33
commit 4f3bc2c9a2
8 changed files with 140 additions and 4 deletions

View File

@@ -68,7 +68,7 @@ Or, distribute `libgamemodeauto.so` and either add `-lgamemodeauto` to your link
---
## Components
**gamemoded** runs in the background, activates game mode on request, refcounts and also checks caller PID lifetime. Accepts `-d` (daemonize) and `-l` (log to syslog).
**gamemoded** runs in the background, activates game mode on request, refcounts and also checks caller PID lifetime. Run `man gamemoded` for command line options.
**libgamemode** is an internal library used to dispatch requests to the daemon. Note: `libgamemode` should never be linked with directly.
@@ -95,7 +95,6 @@ clang-format -i $(find . -name '*.[ch]' -not -path "*subprojects/*")
### Planned Features
* Additional mode-switch plugins
* Improved client state tracking (PID is unreliable)
* API to query if game mode is active
### Maintained by
Feral Interactive