mutt-wizard/bin/openfile

9 lines
320 B
Plaintext
Raw Normal View History

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