summaryrefslogtreecommitdiff
path: root/plugins/osx/osx.plugin.zsh
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/osx/osx.plugin.zsh')
-rw-r--r--plugins/osx/osx.plugin.zsh41
1 files changed, 39 insertions, 2 deletions
diff --git a/plugins/osx/osx.plugin.zsh b/plugins/osx/osx.plugin.zsh
index f278d4f8d..608ec3789 100644
--- a/plugins/osx/osx.plugin.zsh
+++ b/plugins/osx/osx.plugin.zsh
@@ -6,7 +6,7 @@
# ------------------------------------------------------------------------------
function tab() {
- local command="cd \\\"$PWD\\\""
+ local command="cd \\\"$PWD\\\"; clear; "
(( $# > 0 )) && command="${command}; $*"
the_app=$(
@@ -34,7 +34,7 @@ EOF
launch session "Default Session"
set current_session to current session
tell current_session
- write text "${command}; clear;"
+ write text "${command}"
end tell
end tell
end tell
@@ -154,3 +154,40 @@ function trash() {
IFS=$temp_ifs
}
+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 <option>"
+ echo "option:"
+ echo "\tlaunch|play|pause|stop|rewind|resume|quit"
+ echo "\tmute|unmute\tcontrol volume set"
+ echo "\tnext|previous\tplay next or previous track"
+ echo "\thelp\tshow this message and exit"
+ return 0
+ ;;
+ *)
+ print "Unkonwn option: $opt"
+ return 1
+ ;;
+ esac
+ osascript -e "tell application \"iTunes\" to $opt"
+}
+