Skip to content

Instantly share code, notes, and snippets.

@danchoi
Created August 4, 2011 02:13
Show Gist options
  • Save danchoi/1124362 to your computer and use it in GitHub Desktop.
Save danchoi/1124362 to your computer and use it in GitHub Desktop.
macvol - set your Mac's volume from the command line
#!/bin/bash
# This simple script sets the volume on your Mac. Put it on your PATH.
#
# Usage: macvol [volume level]
#
# Without an argument, it returns the current volume level. With an argument,
# it will set the volume level. The volume level may range from 0 to 100.
#
# I use this script to set the volume of my Mac Mini remotely from another
# computer over a SSH session.
#
# Author: Daniel Choi
# [email protected]
# http://danielchoi.com/software
if [ $# -eq 0 ]
then
osascript -e 'get output volume of (get volume settings)'
else
osascript -e "set volume output volume $1"
fi
@HugoHeneault
Copy link

Do you know if we can change specific app volume?

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