-
-
Save Aupajo/e7bc570d318b08a59f211024b278d406 to your computer and use it in GitHub Desktop.
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
#!/usr/bin/env ruby | |
# Examples: | |
# vol Print the current sound volume | |
# vol 30 Set the volume to 30% | |
# vol mute | |
# vol unmute | |
command = case ARGV.first | |
when 'mute' then "set volume output muted true" | |
when 'unmute' then "set volume output muted false" | |
when nil then "output volume of (get volume settings)" | |
else "set volume output volume #{ARGV.first.to_i}" | |
end | |
exec "osascript -e #{command.inspect}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment