Shell script audio input / output switcher


This thing's much faster and probably more performant than audio switcher widgets that use applescript, because it doesn't depend on opening and then closing the system preferences window in the background.

Download it here: BetterTouchTool Preset Sharing Platform

Setup is fairly simple:

  1. Install SwitchAudioSource: brew install switchaudio-osx. This is needed to bypass the preference pane and select audio devices via shell script.

  2. The buttons refresh each other when you press them to show which audio devices are selected, and you may need to update some UUIDs in an additional 'run applescript' action attached to each button.

  3. The preset comes with slots for three different devices; you can easily add more by copying and pasting the buttons and editing a number in each of their shell scripts.

All scripts in the preset are annotated to point out where to make these edits.

Thanks to @burni for the idea!

Very cool!

I found an issue where the selected source's name would be cut off.


I was able to solve this by adding a space at the return of the shell script widget:
echo $button_title $ind_check
instead of
echo $button_title$ind_check

1 Like

thank you so much for this, has some issues with the btn click & activating the correct device name in the bar, but with some searching in the SwitchAudioSource cli & ur script cmnds i finally got it working.

thanks again :wink:

Is anyone able to provide a more dumbed-down tutorial for how to get this button working? I don't quite understand how to start, even after checking out the documentation. Thanks!