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
This command requires a connected display with DDC volume and mute controls available. It does not control every macOS audio output or provide DDC support that the monitor or connection lacks. First check that BetterDisplay’s own mute control works with that monitor.
You can query BetterDisplay’s tracked state with betterdisplaycli get -name="Desk Display" -mute. That is the app’s stored control state, not an independent measurement that the speakers are silent. 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.