# ------------------------------------------------------------------------------ # FILE: osx.plugin.zsh # DESCRIPTION: oh-my-zsh plugin file. # AUTHOR: Sorin Ionescu (sorin.ionescu@gmail.com) # VERSION: 1.1.0 # ------------------------------------------------------------------------------ function tab() { local command="cd \\\"$PWD\\\"; clear; " (( $# > 0 )) && command="${command}; $*" the_app=$( osascript 2>/dev/null </dev/null </dev/null < 0 )) && command="${command}; $*" the_app=$( osascript 2>/dev/null </dev/null < 0 )) && command="${command}; $*" the_app=$( osascript 2>/dev/null </dev/null </dev/null </dev/null < 0 )) && qlmanage -p $* &>/dev/null & } function man-preview() { man -t "$@" | open -f -a Preview } function trash() { local files files=() for item in "$@"; do files=($files "POSIX file \"$(cd "$(dirname "$item")"; pwd)/$(basename "$item")\"") done osascript &> /dev/null <" 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 "\tvol\tSet the volume, takes an argument from 0 to 100" echo "\thelp\tshow this message and exit" return 0 ;; *) print "Unknown option: $opt" return 1 ;; esac osascript -e "tell application \"iTunes\" to $opt" }