xdg-mime can look up the MIME type of a file, but this only works in KDE or Gnome, since the generic path is broken. This issue is known and fixed upstream[1], but since upstream is somewhat dormant[2], it might be worthwhile to fix this in current xdg-utils versions in the tree, especially since the fix is a one-line patch. [1] https://bugs.freedesktop.org/show_bug.cgi?id=11383 [2] http://lists.freedesktop.org/archives/portland/2009-July/001091.html
Created attachment 207354 [details, diff] xdg-mime.patch Patch to the xdg-mime script
fixed by xdg-utils-1.0.2_p20100618