Skip to content

Instantly share code, notes, and snippets.

@niklasl
Created July 28, 2012 18:26
Show Gist options
  • Save niklasl/3194325 to your computer and use it in GitHub Desktop.
Save niklasl/3194325 to your computer and use it in GitHub Desktop.
#!/bin/bash
if [[ $# -lt 1 ]]; then
echo "Usage: $(basename $0) [pause|play|next track|previous track|set sound volume to [0-100]] [HOST]"
exit 0
fi
action=$1
host=$2
cmd="osascript -e 'tell application \"iTunes\" to $action'"
if [ "$host" != "" ]; then
ssh $host $cmd
else
eval $cmd
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment