Skip to content

Instantly share code, notes, and snippets.

@hepto
Last active October 6, 2019 22:38
Show Gist options
  • Save hepto/a1358bdb91ed64090bc1561635f0f609 to your computer and use it in GitHub Desktop.
Save hepto/a1358bdb91ed64090bc1561635f0f609 to your computer and use it in GitHub Desktop.
Bitbar plugin to set a max volume for a given sound device
#!/usr/bin/osascript
set maxVolume to 15
# brew install switchaudio-osx
set deviceSwitcher to "/usr/local/bin/SwitchAudioSource"
set currentDevice to do shell script deviceSwitcher & " -c"
if currentDevice = "Cyrus soundKey" then
set currentVolume to output volume of (get volume settings)
if currentVolume > maxVolume then set volume output volume maxVolume
end if
"👂🏻"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment