Hi Andres, 2011-01-11 03:46, Andres Salomon skrev: > I'd really like midori to play xspf files using parole (a media player). > The mime type used by .xspf is application/xspf+xml. By default, > there's no application associated with them, but one can specify an > application with the following command: > > xdg-mime default parole.desktop application/xspf+xml > > This would work if xdg-mime saw an xspf as the correct mime type; > however, 'xdg-mime query filetype foo.xspf' results in > application/xml. This means that xdg-open will never launch the > correct application for xspf unless it is specifically told the mime > type
This is really a bug in xdg-mime. It also depends on the desktop environment. For example, I'm running Gnome, and here it works: $ xdg-mime query filetype x.xspf application/xspf+xml The reason is that xdg-mime then calls gvfs-info, which uses the shared-mime-info database to determine the MIME type. However, if you're not running Gnome or KDE, xdg-mime will use the "file" command to find out the MIME type. And file doesn't check the extension but only the contents. It doesn't seem to know about XML subtypes, and also isn't very extensible. I think the correct solution would be to always use shared-mime-info to lookup the MIME type. In the generic case, it could be done with the "mimetype" command from libfile-mimeinfo-perl. On a side note, there's also the issue of how to associate applications with MIME types. It's easy when running a desktop environment, because they have their own idea about it. But what is the "generic" approach? Previously, I had patched xdg-open to use run-mailcap in Debian. But now xdg-open apparently uses defaults.list files, according to freedesktop.org standards. I don't know what approach is the correct one. -- Pelle -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org