Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm curious how file association management is implemented in Linux. Where is the related information stored? How do I modify it (I'm interested in non-KDE-based ways; I know there's a system configuration page for that in KDE)?

Links to corresponding articles/documentation will be appreciated :)

share|improve this question
up vote 3 down vote accepted

Most desktop environments use MIME Actions spec. Every program has a .desktop file in /usr/share/applications and/or ~/.local/share/applications, providing information about the program and the MIME types it accepts. User's own preferences are kept in ~/.local/share/applications/defaults.list.

URI schemes, such as http: or mailto:, are simply listed as special x-scheme-handler/scheme MIME types. (Older programs may still be using GNOME- or KDE-specific URI scheme databases, though.)

Some "traditional" mail programs, such as Alpine or Mutt, still use the older ~/.mailcap file for determining the best tool to view attachments with. This is partially because they are purely terminal-based, and require different mechanisms.

share|improve this answer

You can look at the manual (and the actual shell script) for xdg-open. It does check if you are using KDE, Gnome, lxde, and passes the file on to kde-open and so on. If you aren't running any of those, it looks them up using xdg-mime. You can look up information on how this work at freedesktop.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .