-
-
Save gianpaj/6334e6a4cd1f9fe48b58c1e7b8ccd5a2 to your computer and use it in GitHub Desktop.
This script toggles between the two audio devices on macOs using `switchaudio-osx`
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#/bin/bash | |
TOGGLE_TO="Scarlett Solo USB" | |
CURRENT=$(SwitchAudioSource -c -f cli | sed -e 's/,.*//') | |
echo "Current audio device: \"$CURRENT\"" | |
if [ "$CURRENT" = "External Headphones" ]; then | |
SwitchAudioSource -s "Scarlett Solo USB" | |
else | |
SwitchAudioSource -s "External Headphones" | |
fi | |
CURRENT=$(SwitchAudioSource -c -f cli | sed -e 's/,.*//') | |
echo "✅ Switched to: \"$CURRENT\" 🎉" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment