|
|||
Fedora 4.0 and MIME types
Disclaimer: These notes are my own in support of Fedora 4.0 in
ACD -- and specifically how it deals with MIME along with Thunderbird and
Firefox.
Neither I or my organization are responsible for
errors in this document or their consequences.
Updated 10/18/2005 Fedora 4.0 and MIME typesA few MIME related questions keep coming up -- primarily how to deal with .pdf files in a manner other than the Gnome default (which is to bring up evince which in turn brings up Xpdf). We also have issues dealing with other file associations.As I understand it, Fedora 4.0 has gone to a different method of dealing with file associations. That is, Gnome 2.10 which comes with Fedora 4 has adopted the Freedesktop.org approach to mime types. Firefox as of recent versions works through Gnome for its mime types. So does the email reader, Thunderbird, and the desktop file manager, Nautilus. This has the advantage of a single point of maintenance for mime types which then affect all applications which go through Gnome. OS control over MIME behaviorThe directory /usr/share/mime-info seems to have two types of files -- .keys and .mime files. For PDF the configurations look like this:
<mime-type type="application/pdf">
<comment>PDF document</comment>
<magic priority="50">
<match value="%PDF-" type="string" offset="0"/>
</magic>
<glob pattern="*.pdf"/>
<alias type="application/x-pdf"/>
</mime-type>
The long and short of it is that to control a MIME association default, the file to edit seems to be the defaults.list file (in /usr/share/applications). Within this file are entries that control which application comes up for the given mime-type. For example, with PDF the entry looks like: application/pdf=evince.desktop application/pdf=livna-acroread.desktop Editing the file /usr/share/applications/mimeinfo.cache can affect which applications are authorized to handle a particular MIME type in Gnome 2.10+. For example, the entry for pdf looks like this:
application/pdf=evince.desktop;net-xpdf.desktop;livna-acroread.desktop;
kde-kghostview.desktop;kde-kpdf.desktop;
application/pdf=livna-acroread.desktop;evince.desktop;net-xpdf.desktop; Really, though, MIME behavior for Fedora 4.0 out of the box is probably best left to the end-use (see next section below). User control over MIME behaviorNautilus File ManagerIn Nautilus, if you double-click on a .pdf file -- the default behavior in Fedora 4.0 is to launch Xpdf. Just as with Microsoft Windows, if you right click on the file, you get additional options than the Xpdf default. For example, you can select 'Open With' and then 'Open with "adobe reader"'.
The user can control behavior over MIME types with Nautilus by right clicking on
an icon and selecting properties. For example, I can right-click on a pdf document
and select properties to see something like this:
Behind the scenes, what happens are changes within a file $HOME/.local/share/applications/defaults.list. This probably overrides system defaults in /usr/share/applications/defaults.list. Changes are immediately recognized by the Nautilus file manager (without the user having to log out and in). FirefoxFirefox may use a plugin to open a file type (as with the Adobe Reader plugin which opens pdf documents within the browser), or it may go to Gnome for the MIME association. For example, if the user right clicks on a .xls file in Nautilus and sets up the default viewer to be Crossover Office (as opposed to OpenOffice), when Firefox encounters a link to an XLS file,it will prompt the user to open or save the file. If the user selects the option to open the file, Firefox will open the file using Crossover Office (MSWORD.EXE).Thunderbird should follow along with the same behavior. A .xls attachment would open in Crossover Office (MSWORD.EXE) rather than OpenOffice.
References
|
|||