GUIs are just too slow!Posted by Ben Zhao on February 25, 2023 · 2 mins read
You have a task, command, or workflow that you do regularly. The minimal effort it takes to open a setting and navigate to the audio output tab to switch output devices is ever-so-slightly too effortful and irksom. Also, there’s so much data in those GUIs for your eyes to parse, it’s like playing Where’s Waldo every time. That simply won’t do! You want–no, need–a hotkey to do it from anywhere in less than a second. This post will walk through how to set up a hotkey for the aforementioned audio switching workflow, but can be generalized for any workflow.
Open the Automator app:
SwitchAudioSource -i 102 > /dev/nullwhich sets my audio to my headphones.
SwitchAudioSourceis part of the
switchaudio-osxpackage which can be installed by running
brew install switchaudio-osx. The shell may also require the full path to the binary which can be obtained using the
$ which SwitchAudioSource /usr/local/bin/SwitchAudioSource
Open System Preferences: