opener.sh (318B)
1 #!/bin/sh -e 2 # 3 # open file in application based on file extension 4 5 case $(file -bi "$1") in 6 audio/*) 7 exec foot -e 'mpv --no-video "$1"';; 8 video/*) 9 mpv "$1";; 10 image/*) 11 imv "$1";; 12 text/html*) 13 librewolf "$1";; 14 text/*) 15 "${EDITOR:=vi}" "$1";; 16 *) 17 echo "unknown file type: $(file -bi $1)" 18 read _ 19 ;; 20 esac