Created
July 20, 2016 23:28
-
-
Save charandas/e4f7d482865336747befb0b8194422c8 to your computer and use it in GitHub Desktop.
Level control haunted OS X input slider
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
## The script for our case came down to this: | |
| |
while true ; do | |
CURR_LEVEL=$(osascript -e "input volume of (get volume settings)") | |
echo "Setting at : ${CURR_LEVEL}"; | |
while (( $CURR_LEVEL < 50 )); do | |
TARGET_LEVEL=$(($CURR_LEVEL + 3)); | |
echo "Setting to : ${TARGET_LEVEL}"; | |
osascript -e 'display notification "Setting to: '"$TARGET_LEVEL"'" with title "My Mic App"' | |
osascript -e "set volume input volume ${TARGET_LEVEL}"; | |
sleep 0.01; | |
CURR_LEVEL=$(osascript -e "input volume of (get volume settings)"); | |
done; | |
sleep 1; | |
done; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment