summaryrefslogtreecommitdiff
path: root/bin/openfile
blob: 19cb077aff07ce80b4df4be845645e28173003e7 (plain)
1
2
3
4
5
6
7
8
#!/bin/sh
# Helps open a file with xdg-open from mutt in a external program without weird side effects.
base=$(basename "$1")
ext="${base##*.}"
file=$(mktemp -u --suffix=".$ext")
rm -f "$file"
cp "$1" "$file"
setsid xdg-open "$file" >/dev/null 2>&1 &