Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

2 Answers 2

up vote 3 down vote accepted

Most desktop environments use Freedesktop.org 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

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.