Use Alfred to Switch Between AirPods and Default Audio Sources on macOS
Install Alfred.
Install switchaudio-osx:
$ brew install switchaudio-osx
-
Import the Alfred alfred-airpods-selector workflow by double-clicking the workflow file after downloading it.
-
Find your audio device names:
$ SwitchAudioSource -a
-
In the Alfred workflow tab update the bash script (2nd block in workflow) with the names of your audio devices from step #2 as well as the path to where SwitchAudioSource was installed:
switch="/usr/local/bin/SwitchAudioSource" airpods="Paul’s AirPods" mic="Built-in Microphone" output="Built-in Output"
Warning: Sometimes curly apostrophes or curly double quotes can get you into trouble
In Alfred type the following:
To Enable AirPods:
airpods
orairpods on
orairpods blah
To Disable AirPods:
airpods off
Note: You can type anything after 'airpods' except 'off' to enable the AirPods audio source.