nnnopen (273B)
1 #!/usr/bin/env bash 2 3 if [[ ! -f "$1" ]]; then 4 exit 5 fi 6 7 mime=$(file -b --mime-type "$1") 8 echo $mime 9 #texto 10 if [[ "${mime%/*}" = "text" ]]; then 11 nvim "$1" 12 #imaxes 13 elif [[ "${mime%/*}" = "image" ]]; then 14 sxiv "$1" 15 # video 16 if [[ "${mime%/*}" = "video" ]]; then 17 mpv "$1" 18 fi