X-Git-Url: https://src.twobees.de/?a=blobdiff_plain;f=stow%2Foh-my-zsh%2F.oh-my-zsh%2Fplugins%2Fmacos%2Fmacos.plugin.zsh;fp=stow%2Foh-my-zsh%2F.oh-my-zsh%2Fplugins%2Fmacos%2Fmacos.plugin.zsh;h=0000000000000000000000000000000000000000;hb=1a8e170bbe5c6641a26ab1ce2e6ce6c5c1faa4cd;hp=b540eecb5ff8573c82b0d2287cbfd85d272678a4;hpb=475ba35502579302593f4735c853c49ef1845dcb;p=dotfiles.git diff --git a/stow/oh-my-zsh/.oh-my-zsh/plugins/macos/macos.plugin.zsh b/stow/oh-my-zsh/.oh-my-zsh/plugins/macos/macos.plugin.zsh deleted file mode 100644 index b540eec..0000000 --- a/stow/oh-my-zsh/.oh-my-zsh/plugins/macos/macos.plugin.zsh +++ /dev/null @@ -1,268 +0,0 @@ -# Handle $0 according to the standard: -# https://zdharma-continuum.github.io/Zsh-100-Commits-Club/Zsh-Plugin-Standard.html -0="${${ZERO:-${0:#$ZSH_ARGZERO}}:-${(%):-%N}}" -0="${${(M)0:#/*}:-$PWD/$0}" - -# 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_macos_get_frontmost_app() { - osascript 2>/dev/null < 0 )) && command="${command}; $*" - - local the_app=$(_omz_macos_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_macos_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_macos_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() { - # Don't let Preview.app steal focus if the man page doesn't exist - man -w "$@" &>/dev/null && man -t "$@" | open -f -a Preview || man "$@" -} -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 -} - -# Erases purgeable disk space with 0s on the selected disk -function freespace(){ - if [[ -z "$1" ]]; then - echo "Usage: $0 " - echo "Example: $0 /dev/disk1s1" - echo - echo "Possible disks:" - df -h | awk 'NR == 1 || /^\/dev\/disk/' - return 1 - fi - - echo "Cleaning purgeable files from disk: $1 ...." - diskutil secureErase freespace 0 $1 -} - -_freespace() { - local -a disks - disks=("${(@f)"$(df | awk '/^\/dev\/disk/{ printf $1 ":"; for (i=9; i<=NF; i++) printf $i FS; print "" }')"}") - _describe disks disks -} - -compdef _freespace freespace - -# Music / iTunes control function -source "${0:h:A}/music" - -# Spotify control function -source "${0:h:A}/spotify"