Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Nautilus has options for what to do when media devices are added.

Media Handling Preferences

How does Nautilus know what applications to make available in these drop-down menus?

How do applications plug themselves in to this mechanism?

share|improve this question

2 Answers 2

up vote 4 down vote accepted

From http://library.gnome.org/admin/system-admin-guide/stable/mimetypes-registering.html.en:

Registering applications to handle MIME types is fairly straightforward. Applications are registered by creating a MimeType key in their .desktop entry file and listing each MIME type separated by a semicolon. The MimeType key should only be used in .desktop files whose Type key has the value Application. For more information on .desktop files, see Section 2.3 ― Desktop Entry Files.

Nautilus gets this infomation from the mimeinfo.cache files located in $XDG_DATA_DIRS/applications and $XDG_DATA_HOME/applications/ that are created by update-desktop-database.

share|improve this answer

As far as I understand it this is handled by the MIME, the same thing that handles what application opens which files. system (sorry I don't have the full details).

EDIT: DoR answered as I was typing. He nailed it.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.