aboutsummaryrefslogtreecommitdiff
path: root/script/opener_ext
diff options
context:
space:
mode:
authorDylan Araps <dylan.araps@gmail.com>2026-02-28 21:52:26 +0200
committerDylan Araps <dylan.araps@gmail.com>2026-02-28 21:52:26 +0200
commit67a1c24a8661fdcbc48f72f7b65521772065d305 (patch)
tree33c1fbfe2452c23773de046b1127f4920aa5a49f /script/opener_ext
parent4fb29c95c61256f78e4b501a3c550b4c92a92a4e (diff)
dfm: add ranger style bulk rename
Also the ability to embed scripts within dfm.
Diffstat (limited to 'script/opener_ext')
-rwxr-xr-xscript/opener_ext27
1 files changed, 27 insertions, 0 deletions
diff --git a/script/opener_ext b/script/opener_ext
new file mode 100755
index 0000000..ce1699a
--- /dev/null
+++ b/script/opener_ext
@@ -0,0 +1,27 @@
+#!/bin/sh -feu
+#
+# Example DFM_OPENER script using file extension.
+#
+
+case $1 in
+ *.mkv | *.webm | *.mp4 | *.avi)
+ exec mpv -- "$1"
+ ;;
+
+ *.opus | *.mp3 | *.wav | *.flac | *.ogg)
+ exec mus --no-shuffle -- "$1"
+ ;;
+
+ *.jpg | *.jpeg | *.gif | *.png | *.CR2)
+ exec mpv --pause -- "$1"
+ ;;
+
+ *.svg)
+ exec inkscape "$1"
+ ;;
+
+ *?*)
+ exec "${EDITOR:-vim}" "$1"
+ ;;
+esac
+