Last active
October 6, 2019 22:38
-
-
Save hepto/a1358bdb91ed64090bc1561635f0f609 to your computer and use it in GitHub Desktop.
Bitbar plugin to set a max volume for a given sound device
This file contains hidden or 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
#!/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