Remember how I used an Automator Quick Action to set a custom “mute” shortcut on my keyboard? My new friend Ville Walveranta got in touch recently with an even better way to do it. Ville’s way preserves the pre-mute input level, so if you were previously at 50%, it’ll go back to 50% when you un-mute. Nice!
Ville’s solution uses a really great little command-line utility called switchaudio-osx. Once I had that installed, I modified my Quick Action to Run Shell Script rather than AppleScript, and I put in the command:
/opt/homebrew/bin/SwitchAudioSource -t input -m toggle
The utility gives a nice human readable output (“Setting device Logitech StreamCam to muted,” for example) so I decided to pump that straight into my notification. Works great! Thanks Ville. 😄
Leave a Reply