#!/bin/bash
while read filename ; do
case "${filename}" in
    /usr/share/applications/*.desktop)
	MIMETYPES=`grep -h "MimeType=" "${filename}" | sed "s/^MimeType=//" | sed "s/;/\n/g"` 
	for i in $MIMETYPES; do
	    echo "mime($i)"
	done
	;;
esac
done
