From 500e5a73b61b063f83e1eecbf424e4b3733e59b7 Mon Sep 17 00:00:00 2001 From: oxnz Date: Wed, 16 Oct 2013 16:43:03 +0800 Subject: [PATCH] add itunes function to control itnues from the terminal --- plugins/osx/osx.plugin.zsh | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/plugins/osx/osx.plugin.zsh b/plugins/osx/osx.plugin.zsh index dd785f911..608ec3789 100644 --- a/plugins/osx/osx.plugin.zsh +++ b/plugins/osx/osx.plugin.zsh @@ -157,3 +157,37 @@ function trash() { function vncviewer() { open vnc://$@ } + +# iTunes control function +function itunes() { + local opt=$1 + shift + case "$opt" in + launch|play|pause|stop|rewind|resume|quit) + ;; + mute) + opt="set mute to true" + ;; + unmute) + opt="set mute to false" + ;; + next|previous) + opt="$opt track" + ;; + ""|-h|--help) + echo "Usage: itunes