Smart audio output switching

Use a wrapper around DWeller's amazing switchaudiosource, to use partial matching to switch to an audio source by typing part of it's name: out Speak switches to Macbook Pro Speakers.

I use the following script

#!/usr/bin/env bash
# Usage: ./out Speak
if [ "$#" -ne 1 ]; then
  switchaudiosource -a
  exit 1
fi

switchaudiosource -a | grep "$1" | xargs -I _ switchaudiosource -s "_"

Revision #1
Created 4 May 2022 07:45:48 by Sander
Updated 4 May 2022 07:50:05 by Sander