mutt-wizard/bin/openfile

10 lines
315 B
Plaintext
Raw Normal View History

2020-02-09 15:03:10 +01:00
#!/bin/sh
2018-11-06 21:08:23 +01:00
# Helps open a file with xdg-open from mutt in a external program without weird side effects.
[ "$(uname)" = "Darwin" ] && opener="open" || opener="setsid xdg-open"
2019-05-20 21:41:03 +02:00
mkdir -p "/tmp/$USER-mutt-tmp"
file="/tmp/$USER-mutt-tmp/$(basename "$1")"
2018-11-06 21:08:23 +01:00
rm -f "$file"
cp "$1" "$file"
2019-05-02 02:37:12 +02:00
$opener "$file" >/dev/null 2>&1 &