xdg-utils does not implement the standard for default applications

David Faure faure at kde.org
Sat Oct 29 16:25:32 UTC 2016


On lundi 3 octobre 2016 16:09:50 CEST Maxwell Anselm wrote:
> 1. xdg-mime and xdg-open should not rely on Perl's File::MimeInfo at all
> (this behavior could be enabled with an optional flag if you don't want to
> just drop it).
> 2. In the absence of a detected DE, xdg-mime should be fully capable of
> following the shared MIME-info spec to detect a file's MIME type:
> https://specifications.freedesktop.org/shared-mime-info-spec/latest/ar01s02.
> html 3. In the absence of a detected DE, xdg-mime should be fully capable of
> creating associations and storing them in the standard, non-deprecated
> locations:
> https://specifications.freedesktop.org/mime-apps-spec/latest/ar01s02.html
> 4. In the absence of a detected DE, xdg-open should simply use xdg-mime to
> query the MIME type and then use the same standard locations (plus
> deprecated, for compatibility) to look up the default application for that
> type

As a co-maintainer of the shared-mime-info spec and other specs (but not of 
any of the xdg-* tools), I fully agree with your reasoning.

`xdg-mime query` could implement shared-mime-info rather than trying to find an 
existing implementation. Your point 1 would be even extended further: xdg-mime 
would not rely on my kmimetypefinder or on gnomevfs-info/gvfs-info either, 
since it would simply call a tool that implements the spec.

Code exists to do this: see print-mime-data in the git repo "git/xdg/xdgmime".
(of course you need to tweak its input arguments and output format so that it 
can be used by `xdg-mime query`).

However that repo is separate from xdg-utils, so you could end up with the 
issue that xdg-utils is installed but not xdgmime. I think the best approach 
would be to merge these two git repos.
(CC'ing the most recent committers to xdg-utils in case they have input)

-- 
David Faure, faure at kde.org, http://www.davidfaure.fr
Working on KDE Frameworks 5



More information about the xdg mailing list