Skip to content

Instantly share code, notes, and snippets.

@thintsa
Created October 7, 2015 06:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thintsa/a1ae5435e24bc0de03f4 to your computer and use it in GitHub Desktop.
Save thintsa/a1ae5435e24bc0de03f4 to your computer and use it in GitHub Desktop.
This shell script toggles system wide eq using AU Lab and Sound Siphon (see e.g. https://github.com/thintsa/aulab-soundflower-equalizer-toggle) on and off on a Mac. AudioSwitcher app can be found here: https://github.com/deweller/switchaudio-osx.
#!/bin/bash
number=$(ps aux | grep 'AU Lab' | wc -l)
if [ $number -gt 1 ]
then
./AudioSwitcher -s 'Built-in Output'
killall 'AU Lab'
osascript -e 'display notification "System wide EQ disabled" with title "EQ Toggle"'
else
open /Applications/Utilities/AU\ Lab.app/
./AudioSwitcher -s 'Sound Siphon Out'
osascript -e 'tell application "Finder"
repeat
delay 0.1
if (count of windows) of process "AU Lab" is greater than 0 then exit repeat
end repeat
repeat until visible of process "AU Lab" is false
delay 0.1
set visible of process "AU Lab" to false
end repeat
end tell'
osascript -e 'display notification "System wide EQ enabled" with title "EQ Toggle"'
fi
@thintsa
Copy link
Author

thintsa commented Oct 7, 2015

Works on El Capitan too whereas the original toggle script doesn't without signing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment