# Open the current directory in a Finder window alias ofd='open_command $PWD' # Show/hide hidden files in the Finder alias showfiles="defaults write com.apple.finder AppleShowAllFiles -bool true && killall Finder" alias hidefiles="defaults write com.apple.finder AppleShowAllFiles -bool false && killall Finder" # Bluetooth restart function btrestart() { sudo kextunload -b com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport sudo kextload -b com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport } function _omz_osx_get_frontmost_app() { osascript 2>/dev/null < 0 )) && command="${command}; $*" local the_app=$(_omz_osx_get_frontmost_app) if [[ "$the_app" == 'Terminal' ]]; then # Discarding stdout to quash "tab N of window id XXX" output osascript >/dev/null </dev/null <&2 return 1 fi } function vsplit_tab() { local command="cd \\\"$PWD\\\"; clear" (( $# > 0 )) && command="${command}; $*" local the_app=$(_omz_osx_get_frontmost_app) if [[ "$the_app" == 'iTerm' ]]; then osascript </dev/null <&2 return 1 fi } function split_tab() { local command="cd \\\"$PWD\\\"; clear" (( $# > 0 )) && command="${command}; $*" local the_app=$(_omz_osx_get_frontmost_app) if [[ "$the_app" == 'iTerm' ]]; then osascript 2>/dev/null </dev/null <&2 return 1 fi } function pfd() { osascript 2>/dev/null </dev/null </dev/null < 0 )) && qlmanage -p $* &>/dev/null & } function man-preview() { man -t "$@" | open -f -a Preview } compdef _man man-preview function vncviewer() { open vnc://$@ } # Remove .DS_Store files recursively in a directory, default . function rmdsstore() { find "${@:-.}" -type f -name .DS_Store -delete } # Music / iTunes control function source "${0:h:A}/music" # Spotify control function source "${0:h:A}/spotify"