JavaScript is required to for searching.
Skip Navigation Links
Exit Print View
Oracle Solaris 11.1 Desktop Administrator's Guide     Oracle Solaris 11.1 Information Library
search filter icon
search icon

Document Information

Preface

1.  Administering the Oracle Solaris Desktop

2.  Managing User Preferences With GConf

3.  Customizing Menus

4.  Installing Themes

5.  Customizing Fonts

6.  Working With MIME Types

MIME Types Overview

About the MIME Database

MIME Database Contents

Refreshing the MIME Database

Understanding MIME Type XML Files

Modifying MIME Types

How to Add or Modify MIME Types

Registering Applications for MIME Types

How to Register Applications for MIME Types

How to Associate a MIME Type With an Application

7.  Managing Screensavers

8.  Managing Sessions

9.  Overview of the Yelp Help Browser

10.  Improving the Performance of the Oracle Solaris Desktop System

11.  Disabling Features in the Oracle Solaris Desktop System

12.  Working With the X Window System

A.  Hidden Directories

Glossary

Index

Registering Applications for MIME Types

Applications are registered by creating a MimeType key in the .desktop entry file and listing each MIME type separated by a semicolon. The MimeType key should only be used in the .desktop files whose Type key has Application as value. For more information about .desktop files, see How to Add or Modify MIME Types.

How to Register Applications for MIME Types

  1. Create a .desktop file for the application in the $XDG_DATA_HOME/applications or $XDG_DATA_DIRS/applications directory.

    The .desktop file must include a MimeType key whose value comprises each MIME type to be registered, separated by semicolons. For example: MimeType=text/html;text/css;text/x-javascript


    Note - The MimeType key should only be used in the .desktop files whose Type key has Application as the value. For more information about .desktop files, see Working With Desktop Entry Files.


  2. Update the application database.
    # update-desktop-database

    This command creates or updates the mimeinfo.cache file in the same directory as the .desktop file. This cache file is used to facilitate MIME type searches.

  3. Create or update the defaults.list file in the same directory as the .desktop file.

    The defaults.list file is a plain text file that specifies the default application to use for specific MIME types. Each line in the file consists of the MIME type, the = symbol and the Desktop File ID, which is the filename for the desktop entry file. For more information, see Example 6-3.


    Note - Registering MIME types for applications is part of the XDG desktop entry specification rather than the shared mime info specification. For more information, see http://www.freedesktop.org/wiki/Standards/desktop-entry-spec.


Example 6-3 A User's defaults.list File

[Default Applications]
application/pdf=evince.desktop
text/html=epiphany.desktop
text/plain=gedit.desktop
image/jpeg=eog.desktop
image/png=eog.desktop
text/xml=gedit.desktop

How to Associate a MIME Type With an Application

  1. Add a menu item for the application.

    For more information about how to add an item to a menu, see How to Add a Menu.

  2. Add an icon for the application to the /usr/share/icons/theme-name/icon-size/apps directory.

    For more information about installing icons and themes, see Installing Icons for Themes.

  3. If the application uses a new MIME type, perform the following steps:
    1. Add a source XML file to the MIME database.

      For more information, see Modifying MIME Types.

    2. Add an icon for the MIME type to /usr/share/icons/theme-name/icon-size/mimetypes.

      For more information on icons and themes, see Chapter 4, Installing Themes.

  4. To associate the application with a MIME type, include a MimeType key in your .desktop file.

    For more information, see Registering Applications for MIME Types.