aboutsummaryrefslogtreecommitdiff
path: root/config/newsboat/opener.sh
diff options
context:
space:
mode:
Diffstat (limited to 'config/newsboat/opener.sh')
-rwxr-xr-xconfig/newsboat/opener.sh18
1 files changed, 18 insertions, 0 deletions
diff --git a/config/newsboat/opener.sh b/config/newsboat/opener.sh
new file mode 100755
index 0000000..772b35c
--- /dev/null
+++ b/config/newsboat/opener.sh
@@ -0,0 +1,18 @@
+#!/usr/bin/env bash
+
+type="$1"; shift;
+
+video() { mpv --player-operation-mode=pseudo-gui "$@"; }
+image() { feh -x -F --image-bg "#0f0c19" "$@"; }
+
+case "$type" in
+ image) image "$@" ;;
+ video|audio) video "$@" ;;
+ *)
+ case "$1" in
+ https://*youtube.com/watch*) video "$@" ;;
+ https://youtu.be/*) video "$@" ;;
+ *) sensible-browser "$@" 2>&1 >/dev/null & disown ;;
+ esac
+ ;;
+esac;