Taking over xdg-utils

Piotr Karbowski piotr.karbowski at protonmail.ch
Sat Aug 29 21:23:37 UTC 2020


Hi Simon,

On 26/08/2020 09.27, Simon Lees wrote:
> I am also interested in this, there are simply to many bugs related to
> shell quoting behavior etc that break something else when they get
> fixed. Unfortunately I have been moved into a different team at work for
> the next few months and don't have alot of time atm.
> 
> When I did some initial research into the idea I planned to split the
> mime stuff out of pyxdg into a python-mime library and use that as well
> as creating a separate python library for things like
> desktop_file_to_binary etc Unfortunately I didn't get past the design stage.
> 
> While I don't have much time in the next 6 months once you upload the
> code i'll happily review it and help test it on openSUSE.

Will post to list with link to repository once at least basic feature
parity with current xdg-utils is achieved.

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.

For this route the new xdg-mime will just use python-magic (bindings to
libmagic) regardless of what DE is running, as I really see no benefit
in using DE specific tools to query for mime, it will only result in
fragmentation and issues with reproducing bugs, as there's multiple code
paths.

After you mentioned pyxdg I looked into it, from what I see it uses
rox-lib2's mime.py to query shared-mime-datebase, but in this case, I
think I will just stick to python-magic (libmagic) instead, as it seems
to be widely used already in other projects.

If you have any other suggestions, comments or information, please let
me know, I plan to have a working PoC within few weeks (by working I
mean something that will work on my Gentoo for daily usage. :))

-- Piotr.



More information about the xdg mailing list