summaryrefslogtreecommitdiffstats
path: root/.local/bin/webview.sh
diff options
context:
space:
mode:
Diffstat (limited to '.local/bin/webview.sh')
-rwxr-xr-x.local/bin/webview.sh18
1 files changed, 18 insertions, 0 deletions
diff --git a/.local/bin/webview.sh b/.local/bin/webview.sh
new file mode 100755
index 0000000..6975853
--- /dev/null
+++ b/.local/bin/webview.sh
@@ -0,0 +1,18 @@
+#!/usr/local/bin/dash
+
+ext="${1##*.}"
+mpvFiles="mkv mp4 gif"
+sxivFiles="png jpg jpeg jpe"
+wgetFiles="flac mp3 mp3?source=feed opus pdf doc docx"
+
+cd ~/Downloads || exit
+
+if echo "$sxivFiles" | grep -w "$ext" > /dev/null; then
+ nohup sxiv "$1" > /dev/null &
+elif echo "$mpvFiles" | grep -w "$ext" > /dev/null; then
+ nohup mpv --loop --quiet "$1" > /dev/null &
+elif echo "$wgetFiles" | grep -w "$ext" > /dev/null; then
+ nohup st -e wget "$1" > /dev/null &
+else
+ nohup qutebrowser "$1" > /dev/null &
+fi