Re: How can I create a filetype association that uses the filename's extension?
- From: Shaun McCance <shaunm gnome org>
- To: Sietse Brouwer <sbbrouwer gmail com>
- Cc: gnome-list gnome org
- Subject: Re: How can I create a filetype association that uses the filename's extension?
- Date: Fri, 07 Jan 2011 11:53:49 -0500
On Wed, 2011-01-05 at 01:49 +0100, Sietse Brouwer wrote:
> So, the problem is "no obvious way to 'register a new/unknown
> extension'," rather than the "extension ignored when determining
> filetype" I initially reported. Sorry about that. Which would be a
> problem with the Nautilus 'Open With' dialog rather than a problem
> with Gnome itself, in which case I'd better head over to the Nautilus
> mailing list. Does that sound right to you?
Ah. I don't think Nautilus has a GUI for this. You can do it
manually though, using the XDG MIME types system. If you like
If you'd rather have the quick-and-easy version:
Create the folder .local/share/mime/packages in your home
Create a file in that folder with a .xml extension. Call it
"mymimetypes.xml" or whatever you like. Here's one I just made
to register a MIME type for Mallard page files:
<?xml version="1.0" encoding="UTF-8"?>
<comment>Mallard Page File</comment>
Change the type attribute to the MIME type you want. Change the
comment to whatever you want to see files of that type called
in Nautilus. Change the glob pattern to match the extension of
the files. You can have multiple glob elements for each MIME
type to use that type for any of the globs. You can add more
mime-type elements to mime-info to register more types.
Save the file, and run the following at the command line:
Nautilus should pick up the changes immediately.
] [Thread Prev