xdg-open (472B)
- #!/bin/sh
- # Never exits 0 because xdg-open likes trial-and-error
- unsupported() {
- echo "Unsupported target"
- exit 0
- }
- case "$@" in
- 'magnet:'*|*'.torrent')
- unsupported
- ;;
- *'youtube.com/'*|*'.mkv'|*'.mp4'|*'.webm'|*'.avi'|*.'.ogg'|*.'.mp3')
- mpv "$@"
- ;;
- 'https://'*|'http://'*|*'.html')
- badwolf "$@"
- ;;
- *'.pdf'|*'.epub'|*'.mobi')
- evince "$@"
- ;;
- *'.png'|*'.jpg'|*'.jpeg'|*'.webp')
- imv "$@"
- ;;
- *)
- echo "I do not know what to do here"
- exit 0
- ;;
- esac