pulse-server: add condition support in pulse.cmd

So that a config override can disable the execution of the command by
setting the property to false in the pulse.properties config override.

Expose some conf.c method for this purpose.
This commit is contained in:
Wim Taymans 2024-10-22 18:34:59 +02:00
parent 12c8cdf69b
commit 9243ed0cbd
5 changed files with 44 additions and 19 deletions

View file

@ -60,11 +60,17 @@ context.exec = [
# load-module : loads a module with args and flags
# args = "<module-name> <module-args>"
# ( flags = [ nofail ] )
# ( condition = [ { <key1> = <value1>, ... } ... ] )
# conditions will check the pulse.properties key/values.
pulse.cmd = [
{ cmd = "load-module" args = "module-always-sink" flags = [ ] }
{ cmd = "load-module" args = "module-device-manager" flags = [ ] }
{ cmd = "load-module" args = "module-device-restore" flags = [ ] }
{ cmd = "load-module" args = "module-stream-restore" flags = [ ] }
{ cmd = "load-module" args = "module-always-sink" flags = [ ]
condition = [ { pulse.cmd.always-sink = !false } ] }
{ cmd = "load-module" args = "module-device-manager" flags = [ ]
condition = [ { pulse.cmd.device-manager = !false } ] }
{ cmd = "load-module" args = "module-device-restore" flags = [ ]
condition = [ { pulse.cmd.device-restore = !false } ] }
{ cmd = "load-module" args = "module-stream-restore" flags = [ ]
condition = [ { pulse.cmd.stream-restore = !false } ] }
#{ cmd = "load-module" args = "module-switch-on-connect" }
#{ cmd = "load-module" args = "module-gsettings" flags = [ nofail ] }
]