Registering Applications for MIME Types

The application registry contains text files that register applications. The application registration files contain a series of key-value pairs that specify details for applications. For example, the application registration files contain the following information:

  • The command to use to start the application.
  • MIME types to associate with the application.

An application registration file can contain one or more application registrations. Application registration files have a .applications extension.

The location of the application registry is /usr/share/application-registry. This directory contains a default application registration file that is called gnome-vfs.applications.

To register an application, add a registration file for the application to the application registry.

The following is an example of an application registration:

eog command=eog name=Eye of Gnome can_open_multiple_files=true expects_uris=false requires_terminal=false mime_types=image/bmp,image/gif,image/jpeg,image/png,image/tiff, image/x-xpixmap,image/x-bmp,image/x-png,image/x-portable-anymap, image/x-portable-bitmap,image/x-portable-graymap, image/x-portable-pixmap

Table 5-3 describes the keys in application registration files.

Table 5-3Keys for an Application Registration
Key Description
Application identifier Specifies a unique identifier for the application. This identifier must be the same as the identifier in the short_list_application_ids_for_novice_user_level key in the MIME keys file for the application.
command Specifies the command to use to start the application, and any options to use with the command.
name Specifies a name for the application. The name is used in the user interface. For example, the name is used in the Open With submenu in the file manager.
can_open_multiple_files Specifies whether the application can open several files at the same time.
expects_uris Specifies whether the application can process URIs. If the value of this key is true, the application registration entry must also contain a supported_uri_schemes key.
supported_uri_schemes Specifies the URI schemes that the application can process.
requires_terminal Specifies whether to run the application in a terminal window. Enter true for this field for an application that does not create a window in which to run.
mime_types Specifies the MIME types that the application can use.