webview 612 B

12345678910111213141516171819202122
  1. #!/bin/sh
  2. nsxiv="png jpg jpeg jpe webp gif"
  3. zathura="pdf"
  4. mpv="mkv mp4 webm mp3 opus flac"
  5. vidsites="youtube.com
  6. \|yewtu.be"
  7. ext="${1##*.}"
  8. if echo "$nsxiv" | grep -w "$ext" > /dev/null; then
  9. $IMAGE_URL "$1" >/dev/null &
  10. elif echo "$zathura" | grep -w "$ext" > /dev/null; then
  11. curl -sL "$1" > "/tmp/$(echo "$1" | sed "s/.*\///;s/%20/ /g")" && $PDF "/tmp/$(echo "$1" | sed "s/.*\///;s/%20/ /g")" >/dev/null 2>&1 &
  12. elif echo "$mpv" | grep -w "$ext" > /dev/null; then
  13. $VIDEO "$1" > /dev/null &
  14. elif echo "$@" | grep "$vidsites">/dev/null; then
  15. $VIDEO "$1" > /dev/null &
  16. else
  17. $BROWSER "$1" >/dev/null &
  18. fi