How can I mute a DDC monitor from a script?
With BetterDisplay running and the CLI installed, target the monitor and set its mute state:
betterdisplaycli set -name="Desk Display" -mute=on
betterdisplaycli set -name="Desk Display" -mute=off
Replace Desk Display with the monitor’s actual, unambiguous name. The first command mutes it. The second unmutes it. Use explicit states for scripts that may run more than once. For a button that reverses the current state, use:
betterdisplaycli toggle -name="Desk Display" -mute
The command uses the connected display’s configured audio controller. Setting or reading a mute state requires a controller that supports those operations, independently of volume control. The command applies to the selected monitor, rather than every macOS audio output. Before scripting it, check that BetterDisplay’s own mute feature works with the monitor.
If the controller provides only a mute-toggle command, use toggle. Explicit On or Off requests and state queries are unavailable for that controller. See audio mute commands for the controller-specific behavior.
For a controller with a readable mute state, query it with betterdisplaycli get -name="Desk Display" -mute. This returns the state tracked by the app. To confirm that mute worked, check the sound from the speakers. If mute or unmute does not behave as expected, check the monitor’s mute method settings. See CLI setup and device selection for using these commands in scripts.