handy

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

fileinfo (878B)


      1 #! /bin/sh
      2 
      3 while [ $# -gt 0 ] ; do
      4 	mime_type=$(file -L -b --mime-type "$1")
      5 	case $mime_type in
      6 		image/svg+xml)
      7 			inkscape -S "$1"
      8 			;;
      9 		image/gif)
     10 			gifsicle -I "$1"
     11 			;;
     12 		video/* | application/vnd.rn-realmedia | audio/* | image/*)
     13 			mediainfo "$1"
     14 			;;
     15 		application/pdf)
     16 			pdfinfo "$1"
     17 			;;
     18 		application/zip)
     19 			unzip -l "$1"
     20 			;;
     21 		application/x-lha)
     22 			lha -l "$1"
     23 			;;
     24 		application/x-rar)
     25 			unrar lb "$1"
     26 			;;
     27 		application/x-bittorrent)
     28 			aria2c -S "$1" | grep '\./'
     29 			;;
     30 		application/x-iso9660-image)
     31 			isoinfo -J -l -i "$1"
     32 			;;
     33 		application/vnd.ms-opentype)
     34 			otfinfo -i "$1"
     35 			;;
     36 		*)
     37 			case "$1" in
     38 				*.torrent)
     39 					aria2c -S "$1" | grep '\./'
     40 					;;
     41 				*.mkv)
     42 					mediainfo "$1"
     43 					;;
     44 				*.ace)
     45 					unace l "$1"
     46 					;;
     47 				*.icns)
     48 					icns2png -l "$1"
     49 					;;
     50 				*)
     51 					file -b "$1"
     52 					;;
     53 			esac
     54 			;;
     55 	esac
     56 	shift
     57 done