From 1f4bb8deb7bf166a43ed690b0961ab5a0b84523d Mon Sep 17 00:00:00 2001 From: Anders Andersson Date: Sun, 30 Dec 2012 09:52:32 +0100 Subject: [PATCH 1/3] OpenBSD doesn't have -ef flags for ps. Both linux and OpenBSD have -x flags which works just as greate here --- plugins/ssh-agent/ssh-agent.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/ssh-agent/ssh-agent.plugin.zsh b/plugins/ssh-agent/ssh-agent.plugin.zsh index c4e92a1fe..650eb3f3c 100644 --- a/plugins/ssh-agent/ssh-agent.plugin.zsh +++ b/plugins/ssh-agent/ssh-agent.plugin.zsh @@ -48,7 +48,7 @@ if [[ ${_plugin__forwarding} == "yes" && -n "$SSH_AUTH_SOCK" ]]; then elif [ -f "${_plugin__ssh_env}" ]; then # Source SSH settings, if applicable . ${_plugin__ssh_env} > /dev/null - ps -ef | grep ${SSH_AGENT_PID} | grep ssh-agent$ > /dev/null || { + ps -x | grep ${SSH_AGENT_PID} | grep ssh-agent > /dev/null || { _plugin__start_agent; } else From 500e5a73b61b063f83e1eecbf424e4b3733e59b7 Mon Sep 17 00:00:00 2001 From: oxnz Date: Wed, 16 Oct 2013 16:43:03 +0800 Subject: [PATCH 2/3] 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