about summary refs log tree commit diff
path: root/contrib/mopenall
diff options
context:
space:
mode:
authorLeah Neukirchen <leah@vuxu.org>2022-03-10 22:11:13 +0100
committerLeah Neukirchen <leah@vuxu.org>2022-03-10 22:11:13 +0100
commit47c5707d50f5b97e43e120159138e042fe3c5f71 (patch)
tree967587daa9fe83140b06c27e27a66967643a03c6 /contrib/mopenall
parentcd5bc471f3cffd7b35cc98c4199fb1dd27cc3ef9 (diff)
downloadmblaze-47c5707d50f5b97e43e120159138e042fe3c5f71.tar.gz
mblaze-47c5707d50f5b97e43e120159138e042fe3c5f71.tar.xz
mblaze-47c5707d50f5b97e43e120159138e042fe3c5f71.zip
add contrib/mopenall
Diffstat (limited to 'contrib/mopenall')
-rw-r--r--contrib/mopenall18
1 files changed, 18 insertions, 0 deletions
diff --git a/contrib/mopenall b/contrib/mopenall
new file mode 100644
index 0000000..7362197
--- /dev/null
+++ b/contrib/mopenall
@@ -0,0 +1,18 @@
+#!/bin/sh -e
+# mopenall [MSG] - open every attachements in xdg-open
+
+[ "$#" -eq 0 ] && set -- .
+
+f="$(mseq "$1" | sed 1q)"
+[ -z "$f" ] && printf 'No message %s.\n' "$1" 1>&2 && exit 1
+
+dir=$(mktemp -d -t menter.XXXXXX)
+cd "$dir"
+mshow -t "$1"
+mshow -B -x "$1" 2>/dev/null
+for f in * ; do
+    xdg-open "$f" &
+done
+wait
+echo rm -r "$dir"
+rm -r "$dir"