droplr.plugin.zsh 343 B

123456789101112131415
  1. # Only compatible with MacOS
  2. [[ "$OSTYPE" == darwin* ]] || return
  3. droplr() {
  4. if [[ $# -eq 0 ]]; then
  5. echo You need to specify a parameter. >&2
  6. return 1
  7. fi
  8. if [[ "$1" =~ ^http[|s]:// ]]; then
  9. osascript -e "tell app 'Droplr' to shorten '$1'"
  10. else
  11. open -ga /Applications/Droplr.app "$1"
  12. fi
  13. }