Freedesktop.org mime-actions-spec (http://freedesktop.org/wiki/Specifications/mime-actions-spec) states that default application for a MIME type is the one that is listed first for a given MIME type in section [Added Associations] of mimeapps.list, e.g.: ------ [Added Associations] mimetype1=foo1.desktop;foo2.desktop;foo3.desktop; ------ foo1 will will be default for mimetype1 But xdg-open/xdg-mime (via generic function) uses [Default Applications] section which is not covered in mime-actions-spec and therefore should not even exist in mimeapps.list. It also completely ignores standard [Added Associations] section in mimeapps.list. I edit mimeapps.list: ------ [Added Associations] application/testapp=leafpad.desktop; ------ then run: xdg-mime query default application/testapp It returns nothing, but should return "leafpad.desktop".
What desktop environment are you using? xdg-utils leverages DE-specific utilities to query/set this stuff, when they are available, for example, under KDE uses: ktraderclient That said, looks like the current code only groks [Default Applications] section of mimeapps.lst
I use plain openbox, therefore xdg-open goes through open_generic function. No non-standard DE-specific association exceptions should apply.
Agreed, this is generating confusion and incompatibility with the spec being one way and xdg-open handling it in another way.
Hi! any news on this?
For me personally, if there was news, I'd post notice about it here. I haven't had any time to implement this feature in the generic functions.
The generic functions *do* implement this functionality. The `xdg-mime` utility knows how to deal with mimeapps.list but does it incorrectly. It uses a `[Default Applications]` header not covered in the specification rather than the proper `[Added Associations]` section. The fix is as easy as a quick search and replace of two strings.
Re-reading http://standards.freedesktop.org/mime-apps-spec/mime-apps-spec-1.0.html today. Important bits: --------------------------- 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. --------------------------- --------------------------- 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 --------------------------- --------------------------- 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 ... --------------------------- So looks like this has been clarified since the bug was filed, and that all of: [Default Applications] [Added Associations] [Removed Associations] need to be taken into account, highlighting that the xdg-open generic algorithm definitely needs work to comply.
Given the looming (and hopefully soon) release of xdg-utils-1.1.0 (final), I personally won't have the time or interest in the short-term to implement this properly, and until it is implemented, I'm seriously considering making the existing open_generic code be a last-ditch fallback, and prefer (and strongly recommend) a better implementation be present and used instread, including: gvfs-open kde-open and possibly even others: gnome-open mate-open exo-open
-- GitLab Migration Automatic Message -- This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/xdg/xdg-utils/issues/61.
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.