mutt-wizard/bin/openfile

9 lines
312 B
Plaintext
Raw Normal View History

2018-11-06 15:08:23 -05:00
#!/bin/sh
# 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 &