From 1378e31bad614bd153f385859773a5d40469d069 Mon Sep 17 00:00:00 2001 From: Florian Pritz Date: Tue, 11 Sep 2018 12:01:40 +0200 Subject: Add mutt-open Signed-off-by: Florian Pritz --- mutt-open | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100755 mutt-open 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" -- cgit v1.2.3-24-g4f1b