Skip to content

config: add "enable" property to every monitor

Théo Lebrun requested to merge tleb/wireplumber:config-enable-rework into master

This is a draft MR to discuss the subject, it has not been thoroughly tested.

The idea of this patch is to allow easy disabling of monitors in the Lua config. Currently, a function called MONITOR.enable() is called that registers the required components. This patch adds a enable property to allow disabling monitors without commenting the call to MONITOR.enable(). This allows easier scripting for config changes. Previously, the changes had to comment out a specific line in the config file that called the concerned .enable().

Following this patch, disabling a monitor only requires creating a file in between 50 and 90 (currently) that has the line MONITOR.properties["enable"] = false. This allows for easier scripting and packaging: this way, the /usr/share config files can be left untouched and only files in /etc need to be modified to disable a monitor.

It could also be a field directly on the MONITOR table for a nicer API, as in MONITOR.enabled = true; it's not really a property of the monitor.

Any opinions? :)

Edited by George Kiagiadakis

Merge request reports