GUIs are just too slow!
Posted by Ben Zhao on February 25, 2023 · 2 mins readYou 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/null
which sets my audio to my headphones.Tips:
SwitchAudioSource
is part of theswitchaudio-osx
package which can be installed by runningbrew install switchaudio-osx
. The shell may also require the full path to the binary which can be obtained using thewhich
command:$ which SwitchAudioSource /usr/local/bin/SwitchAudioSource
Open System Preferences: