1
0
Fork 0
dotfiles/bin/default-open
2017-12-04 22:12:36 -08:00

10 lines
212 B
Bash
Executable file

#!/bin/sh
mimetype=$1
original=$2
ext=$(grep "$mimetype" /etc/mime.types | awk '{print $2}')
destination=$(mktemp --suffix=".$ext")
cp $original $destination
xdg-open $destination &> /dev/null
cat $destination