From 8ab81298c5db43bc3f8fe70d02157bfbf5793a48 Mon Sep 17 00:00:00 2001 From: David Faure Date: Thu, 3 Apr 2014 10:41:10 +0200 Subject: mime-apps: new spec; discussed and approved live and on the xdg@ mailing-list. --- mime-apps/mime-apps-spec.xml | 98 ++++++++++++++++++++++++++++++++++++++++++++ web-export/specs.idx | 2 + 2 files changed, 100 insertions(+) create mode 100644 mime-apps/mime-apps-spec.xml diff --git a/mime-apps/mime-apps-spec.xml b/mime-apps/mime-apps-spec.xml new file mode 100644 index 0000000..86b9371 --- /dev/null +++ b/mime-apps/mime-apps-spec.xml @@ -0,0 +1,98 @@ + +
+ + + + X Desktop Group + + + David + Faure + +
+ faure@kde.org +
+
+
+
+ Association between MIME types and applications + 2 April 2014 + 1.0 +
+ + Introduction + 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. + + + File name and location + 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: + + + + + $XDG_CONFIG_HOME/$xdc-mimeapps.listuser overrides, desktop-specific (for advanced users) + + $XDG_CONFIG_HOME/mimeapps.listuser overrides (recommended location for user configuration GUIs) + + $XDG_CONFIG_DIRS/$xdc-mimeapps.listsysadmin and ISV overrides, desktop-specific + + $XDG_CONFIG_DIRS/mimeapps.listsysadmin and ISV overrides + + $XDG_DATA_HOME/applications/$xdc-mimeapps.listfor completeness, deprecated, desktop-specific + + $XDG_DATA_HOME/applications/mimeapps.listfor compatibility, deprecated + + $XDG_DATA_DIRS/applications/$xdc-mimeapps.listdistribution-provided defaults, desktop-specific + + $XDG_DATA_DIRS/applications/mimeapps.listdistribution-provided defaults + + + + + 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. + + + Default Application + 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 next section. + + + Adding/removing associations + 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. + + + Application ordering + The suggested algorithm for listing the applications associated to a given mimetype is: + + add any "Default Applications" and then "Added Associations" in the first mimeapps.list + make a blacklist with the "Removed Associations" in the first mimeapps.list + add any "Default Applications" and then the "Added Associations" in the second mimeapps.list, except those in the current blacklist + append to the blacklist the "Removed Associations" in the second mimeapps.list + repeat the last two steps for all subsequent mimeapps.list files + finish by adding the mimetypes listed in the .desktop file, except those in the blacklist + + + +
diff --git a/web-export/specs.idx b/web-export/specs.idx index 62c467f..075d392 100644 --- a/web-export/specs.idx +++ b/web-export/specs.idx @@ -40,6 +40,8 @@ git:xdg/default-icon-theme:spec/icon-theme-spec.xml 61ce5bd0f09d5026b32f015f7 git:xdg/default-icon-theme:spec/icon-theme-spec.xml bd6077c5fc235d830d325a977770150bd2d71136 0.7 icon-theme-spec git:xdg/default-icon-theme:spec/icon-theme-spec.xml b1a891e95eb4f28da4e43fb6cb7a662bc0431529 0.6 icon-theme-spec +git:xdg/xdg-specs:mime-apps/mime-apps-spec.xml master 1.0 mime-apps-spec + git:xdg/xdg-specs:menu/menu-spec.xml master 1.1 menu-spec git:xdg/xdg-specs:menu/menu-spec.xml 647153fb87e5f642a7b7a3fdcec90961f36e89ab 1.0 menu-spec git:xdg/xdg-specs:menu/menu-spec.xml a61b06aa1aee4743f50024b0695795fe9568d929 0.92 menu-spec -- cgit v1.2.3-70-g09d2