[Wylug-help] setting the default application for a particular file mime type in gnome.

David Holden dh at iucr.org
Wed Oct 11 12:56:50 BST 2006


On Tuesday 10 October 2006 22:15, Linda Kennedy & David Carpenter wrote:
> Had a quick look around, and came up with this advice at the gnome site.
>
> I think you have to first create the new MIME type on the system (the
> xxx in file.xxx)
>
> Have a look at Modifying MIME types:
> http://www.gnome.org/learn/admin-guide/2.14/mimetypes-modifying.html
> There is an example on how to do it here:
> http://www.gnome.org/learn/admin-guide/2.14/mimetypes-modifying.html#mimety
>pes-newtype-example
>
> I think once you have done this then the 'right click' suggestions
> others have suggested and you got stuck with because the MIME type was
> automatically picked up as text/plain (as described in the how to...)
> may well work, if not.....
>
>
> Maybe you want to look at:
> Registering Applications for MIME Types -
> http://www.gnome.org/learn/admin-guide/2.14/mimetypes-registering.html
>
> Notes:
> I ran a search on .desktop on my file system to find the .desktop files
> this article speaks of, and opened one up in gedit and it seemed to make
> some sense. i.e. there was a MIME type entry where I could add another
> mime type, and it was a file that had TYPE = Application.
>
> The page I've referenced says that it's straight forward, but it's not
> something I've done.
>
> The instructions are for Gnome 2.14 I believe.
>
> There is a whole section here on mime types if you check the links on
> the right hand side of the page.
>
> Hope this is of some use.
>
> David
>



Thanks for all the replies everyone.

Looking from the various links you all given and some I got from the ubuntu 
list the following seems to
have worked, although I'm still a bit hazy on it.


I used the mime-editor application from here

http://rox.sourceforge.net/desktop/MIME-Editor

to add a mime type, in this case 

application/iwl 

This seems to create a file in ~/.local/share/mime/packages called
Override.xml

<?xml version="1.0" ?>
<mime-info xmlns="http://www.freedesktop.org/standards/shared-mime-info">
    <mime-type type="application/x-iwl">
        <comment>CIF move application</comment>
    <glob pattern="*.iwl"/></mime-type>
</mime-info>

after logging out and logging in again nautilus listed files with suffix
.iwl differently but when I clicked on them they changed to type text/plain
and double clicking caused a warning to appear saying the file contents
indicated its a plain/text file but the application type was of "CIF
move application" (I assume from the comment tag)

So I added

          <sub-class-of type="text/plain"/>


<?xml version="1.0" ?>
<mime-info xmlns="http://www.freedesktop.org/standards/shared-mime-info">
    <mime-type type="application/x-iwl">
          <sub-class-of type="text/plain"/>
        <comment>CIF move application</comment>
    <glob pattern="*.iwl"/></mime-type>
</mime-info>

Once I had done this nautilus allowed me to assign a default application
separately from the default plain/text type application.

Thanks,

 Dave.


-- 
Dr. David Holden.

See: <http://www.gnu.org/philosophy/no-word-attachments.html>
regarding Word or PowerPoint. GPG key available on request.
-------------------------------------------------------------



More information about the Wylug-help mailing list