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 applies to the selected monitor, rather than every macOS audio output. Before scripting it, check that BetterDisplay’s own mute control works with the monitor.
You can query BetterDisplay’s tracked state 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.