]> src.twobees.de Git - dotfiles.git/blob - stow/oh-my-zsh/.oh-my-zsh/plugins/droplr/droplr.plugin.zsh
initial
[dotfiles.git] / stow / oh-my-zsh / .oh-my-zsh / plugins / droplr / droplr.plugin.zsh
1 # Only compatible with MacOS
2 [[ "$OSTYPE" == darwin* ]] || return
3
4 droplr() {
5     if [[ $# -eq 0 ]]; then
6         echo You need to specify a parameter. >&2
7         return 1
8     fi
9
10     if [[ "$1" =~ ^https?:// ]]; then
11         osascript -e 'tell app "Droplr" to shorten "'"$1"'"'
12     else
13         open -ga /Applications/Droplr.app "$1"
14     fi
15 }