Taking over xdg-utils

Emmanuele Bassi ebassi at gmail.com
Sun Aug 30 13:18:15 UTC 2020


On Sat, 29 Aug 2020 at 22:23, Piotr Karbowski <piotr.karbowski at protonmail.ch>
wrote:


> My goal is to create a drop-in replacement for xdg-utils, while greatly
> simplifying the logic. For example, xdg-open uses xdg-mime, and xdg-mime
> have whole logic to choose what tool it should use to query for
> mimetype, if there's kde, it will use kmimetypefinder, if there's gnome
> it will use gio and fallback to gvfs-info, if it fail to detect DE, it
> will use mimeinfo written in Perl instead.
>

This approach is entirely broken, and I'd recommend you not do this if you
want to take over the maintenance of a freedesktop component.

All applications that are not Python scripts use the shared-mime database,
which is a) a freedesktop specification b) hosted on freedesktop. Using
libmagic would automatically make your xdg-utils replacement something that
is not adhering to freedesktop specifications, and thus would move it
outside of the scope of freedesktop entirely.

Libmagic does not use the shared-mime database; it requires opening files
for content sniffing instead of allowing the use of extensions for fast
content type checks; it has its own magic database, with its own format,
maintained inside the libmagic repository and tied to its implementation.

Yes, the xdg-utils are somewhat broken by design, with them being shell
scripts checking the desktop environment to determine what native tool
should be called. They solve the problems of lack of resources in fd.o, as
well as the issue of system administrators trying to bash script their way
around things, instead of platform developers actually fixing them.

The proper solution to this issue is to write a reference implementation,
using the freedesktop specifications, instead of using something else
entirely. The xdg-utils should be for freedesktop specifications what
libdbus is for the DBus specification: the reference implementation, which
can then be used to verify the compliance of any other implementation.

Ciao,
 Emmanuele.

-- 
https://www.bassi.io
[@] ebassi [@gmail.com]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/xdg/attachments/20200830/de7762e3/attachment.htm>


More information about the xdg mailing list