diff options
author | Florian Pritz <bluewind@xinu.at> | 2018-09-11 12:01:40 +0200 |
---|---|---|
committer | Florian Pritz <bluewind@xinu.at> | 2018-09-11 12:02:12 +0200 |
commit | 1378e31bad614bd153f385859773a5d40469d069 (patch) | |
tree | dee70f0564b44779ae1133da7511ffc5210fc395 /mutt-open | |
parent | 4876fefb40b3eded5eda181755852d7251daec9f (diff) | |
download | bin-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-x | mutt-open | 13 |
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" |