logo

dotfiles

My dotfiles, one branch per machine, rebased on base git clone https://anongit.hacktivis.me/git/dotfiles.git/

xdg-open (472B)


  1. #!/bin/sh
  2. # Never exits 0 because xdg-open likes trial-and-error
  3. unsupported() {
  4. echo "Unsupported target"
  5. exit 0
  6. }
  7. case "$@" in
  8. 'magnet:'*|*'.torrent')
  9. unsupported
  10. ;;
  11. *'youtube.com/'*|*'.mkv'|*'.mp4'|*'.webm'|*'.avi'|*.'.ogg'|*.'.mp3')
  12. mpv "$@"
  13. ;;
  14. 'https://'*|'http://'*|*'.html')
  15. badwolf "$@"
  16. ;;
  17. *'.pdf'|*'.epub'|*'.mobi')
  18. evince "$@"
  19. ;;
  20. *'.png'|*'.jpg'|*'.jpeg'|*'.webp')
  21. imv "$@"
  22. ;;
  23. *)
  24. echo "I do not know what to do here"
  25. exit 0
  26. ;;
  27. esac