[New] Desktop Preferred Applications Specification

Alexander Larsson alexl at redhat.com
Tue Jun 9 02:09:15 PDT 2009


On Sun, 2009-06-07 at 13:52 +0800, PCMan wrote:
> Hi list,
> To solve the issue that every desktop environment has its own way to
> specify default web browser and terminal emulator, I wrote a new spec
> to create a cross-desktop mechanism for this. This spec works by
> extending existing XDG specs and only requires minimal changes to
> existing systems without breaking backward compatibility. Besides, it
> can work in an desktop independent way, and can work with existing xdg
> tools like desktop-utils.
> 
> Here is the full specification.
> http://wiki.lxde.org/en/Desktop_Preferred_Applications_Specification
> 
> This spec is going to be implemented by LXDE later.

I'm not really thrilled by this, for various reasons.

First of all, it further misuses the "mimetype" to mean yet another
completely different thing, making mimetypes even more vague and
polluting the mimetype database with more weird stuff (that may be
visible in e.g. UIs listing all known types).

Secondly, and more problematic is the fact that URI handlers are a very
sensitive area that needs quite a lot of care. This is because setting
an uri scheme handler is a very high-priority thing that will override
any per-mimetype association for all files on that uri scheme. So, if
you define a uri scheme handler for any protocol that also has regular
files, say ftp then when you're browsing an ftp site in the file manager
and click on a jpeg file it will open in your ftp program, not in the
image viewer.

This is true already, but the problem is made much larger if we use the
mime spec like this, because due to how the mime database works any app
that lists application/x-xdg-protocol-ftp would be set as the default
for that minetype, so one such app installed would immediately override
any mimetype based file open for ftp sites.

I'm not opposed to standardizing uri handlers, but I don't think using
mimetypes and the mimetype association handling for this is the right
thing. These are distinct things that are problematic if mixed up. 

I think the right approach is to have another key in the desktop files
for uri protocol handling, and separate file(s) that keeps track of the
uri scheme to application mapping. The desktop file key would be handled
differently than the mimetime key in that it would not affect the
default app for this uri scheme and would only be used by the UI to list
the availible apps for configuring a uri handler. The actual defaults
could be listed with a simple ini-style files (systemwide and in xdg
config dirs for sysadmin config with overrides in the users homedir).





More information about the xdg mailing list