After so many years, he's finally a proposal for a unified mechanism for selecting the default application for a given mimetype.
The mechanism is unified, but note that it supports different defaults for different desktop environments, if so desired. This is the result of a discussion with Ryan Lortie, Alex Larsson and myself, I'm sending it here for further comments before pushing it to the git repo. -- David Faure, [email protected], http://www.davidfaure.fr Working on KDE, in particular KDE Frameworks 5Title: Association between MIME types and applications
Table of Contents The freedesktop.org Shared MIME database provides a single way to store static information about MIME types and rules for determining a type. The freedesktop.org Desktop Entry specification allows applications to announce which MIME types they support. This specification solves the remaining issues: which application should open a file by default, how to let the user change the default application, and how to let the user add or remove associations between applications and mimetypes. Users, system administrators, application vendors et distributions can change associations between applications and mimetypes by writing into a file called mimeapps.list. The lookup order for this file is as follows:
In this table, $xdc means the lowercase version of $XDG_CURRENT_DESKTOP (for instance, kde, gnome, xfce, etc.) All of the above files are referred to as "mimeapps.list" in the rest of this specification, for simplicity. Indicating the default application for a given mimetype is done by writing into the group [Default Applications] in the file mimeapps.list. The [Default Applications] group indicates the preferred application for a given mimetype. This is for instance the one that will be started when left-clicking on a file in a file manager. If the application is no longer installed, the next application in the list is used. This example ensures that the application default1.desktop will be used for mimetype1, if it's installed, and otherwise default2.desktop if it's installed: [Default Applications] mimetype1=default1.desktop;default2.desktop
In the absence of such an entry, the next mimeapps.list is checked. Once all levels have been checked, if no entry could be found, the implementations can pick any of the .desktop files associated with the mimetype, taking into account added and removed associations as per the previous section. Adding and removing associations between mimetypes and applications is done with the following syntax in the mimeapps.list file: [Added Associations] mimetype1=foo1.desktop;foo2.desktop;foo3.desktop mimetype2=foo4.desktop [Removed Associations] mimetype1=foo5.desktop
The [Added Associations] group defines additional associations of applications with mimetypes, as if the .desktop file was listing this mimetype in the first place. The entries in [Default Applications] should also be considered to add an association between application and mimetype in the same manner. The [Removed Associations] group removes associations of applications with mimetypes, as if the .desktop file was NOT listing this mimetype in the first place. The suggested algorithm for listing the applications associated to a given mimetype is:
|
_______________________________________________ xdg mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/xdg
