Nautilus has options for what to do when media devices are added.
How does Nautilus know what applications to make available in these drop-down menus?
How do applications plug themselves in to this mechanism?
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. TheMimeType
key should only be used in.desktop
files whoseType
key has the valueApplication
. 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
.
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.