summaryrefslogtreecommitdiffstats
path: root/mutt-open
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2018-09-11 12:01:40 +0200
committerFlorian Pritz <bluewind@xinu.at>2018-09-11 12:02:12 +0200
commit1378e31bad614bd153f385859773a5d40469d069 (patch)
treedee70f0564b44779ae1133da7511ffc5210fc395 /mutt-open
parent4876fefb40b3eded5eda181755852d7251daec9f (diff)
downloadbin-1378e31bad614bd153f385859773a5d40469d069.tar.gz
bin-1378e31bad614bd153f385859773a5d40469d069.tar.xz
Add mutt-open
Signed-off-by: Florian Pritz <bluewind@xinu.at>
Diffstat (limited to 'mutt-open')
-rwxr-xr-xmutt-open13
1 files changed, 13 insertions, 0 deletions
diff --git a/mutt-open b/mutt-open
new file mode 100755
index 0000000..00dbca1
--- /dev/null
+++ b/mutt-open
@@ -0,0 +1,13 @@
+#!/bin/bash
+
+# simple wrapper that copies the file recieved by mutt to a temporary directory and open it in the background
+
+set -euo pipefail
+
+command=$1
+file=$2
+
+tmpdir=$(mktemp -d 'mutt-open.XXXXXXXXX')
+filename="${1##*/}"
+cp "$file" "$tmpdir/$filename"
+systemd-cat "$command" "$tmpdir/$filename"