1
0
Fork 0
dotfiles/bin/default-open

10 lines
224 B
Bash
Executable file

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