summaryrefslogtreecommitdiff
path: root/ar/.local
diff options
context:
space:
mode:
Diffstat (limited to 'ar/.local')
-rwxr-xr-xar/.local/bin/openurl16
1 files changed, 16 insertions, 0 deletions
diff --git a/ar/.local/bin/openurl b/ar/.local/bin/openurl
new file mode 100755
index 0000000..cd096e1
--- /dev/null
+++ b/ar/.local/bin/openurl
@@ -0,0 +1,16 @@
+#!/bin/bash
+
+ext="${1##*.}"
+mpvfiles="avi flv mkv mov mpeg mpg mp4 rmvb webm wmv w3m ogv ts 3gp"
+nsxivfiles="png jpg jpeg jpe gif bmp tiff tif"
+wgetfiles="mp3 flac opus wav aac wma m4a mp3?source=feed"
+
+if echo $mpvfiles | grep -w $ext >/dev/null; then
+ nohup mpv --loop --quiet "$1" >/dev/null 2>&1 &
+elif echo $nsxivfiles | grep -w $ext >/dev/null; then
+ nohup nsxiv "$1" >/dev/null 2>&1 &
+elif echo $wgetfiles | grep -w $ext >/dev/null; then
+ nohup wget "$1" >/dev/null 2>&1 &
+else
+ nohup "$BROWSER" "$1" >/dev/null 2>&1 &
+fi