diff options
Diffstat (limited to 'webview.sh')
-rw-r--r-- | webview.sh | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/webview.sh b/webview.sh new file mode 100644 index 0000000..611deb1 --- /dev/null +++ b/webview.sh @@ -0,0 +1,22 @@ +#!/bin/bash + +# Feed script a url. + +ext="${1##*.}" +mpvFiles="mkv mp4 gif" +pqivFiles="png jpg jpeg jpe" +wgetFiles="mp3 pdf" + +# Check youtube link +if echo "$1" | grep youtube > /dev/null; then + nohup mpv --loop "$1" >/dev/null & +# General checks +elif echo $pqivFiles | grep -w $ext > /dev/null; then + i3 exec pqiv "$1" >/dev/null & +elif echo $mpvFiles | grep -w $ext > /dev/null; then + i3 exec mpv --loop "$1" >/dev/null & +elif echo $wgetFiles | grep -w $ext > /dev/null; then + i3 exec wget "$1" >/dev/null & +else + i3 exec qutebrowser "$1" >/dev/null & +fi |