summaryrefslogtreecommitdiff
path: root/bin/openfile
blob: fdc0e5fcaa8bb3c1fba536850cd2ba519f11b70a (plain)
1
2
3
4
5
6
7
8
9
#!/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 &