Skip to content

Instantly share code, notes, and snippets.

@quickshiftin
Created February 23, 2014 20:56
Show Gist options
  • Save quickshiftin/9177170 to your computer and use it in GitHub Desktop.
Save quickshiftin/9177170 to your computer and use it in GitHub Desktop.
Set the volume on a mac over the network with SSH
function remote_volume
{
local user="$1"
local host="$2"
local vol="$3"
ssh "$user"@"$host" 'osascript -e "set volume output volume '"$vol"'"'
}
@quickshiftin
Copy link
Author

This will let you set the volume on a Mac on your network. It's designed to work over an SSH key. If you don't know how to set those up, look here. Set the public SSH key on the remote box, then put the above function in ~/.profile on your mac. Now from your mac you can run this function from the terminal like so

remote_volume <user> <host> <percent_volume>

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