❦ 13 juillet 2012 12:18 CEST, Per Olofsson <firstname.lastname@example.org> :
Yes, I also think this is a good plan.
> 1. Rewrite xdg-utils so that it is robust and always works. Instead of
> relying on desktop environments, it should do the needed work by
> itself. Currently it's something of a hack, especially when running in
> "generic" mode. It should probably be written in another language than
> shell (e.g. Perl, Python, C). A nicer user interface for the command
> line wouldn't hurt either.
> 2. Make all other packages either use xdg-utils or follow the
> freedesktop.org MIME specs.
Relying on existing desktop tools is too difficult. They get deprecated
(for example, gnome-open has been replaced by gvfs-open) or they cannot
be adapted easily because maintainers usually don't care about those
corner use cases. For example, gvfs-open does not wait for the viewer to
terminate, this makes difficult for mailers to pass a temporary
Once you get a working xdg-open, you can get a compatibility layer for
the mailcap stuff:
*/*; xdg-open '%s'; test=test -n "$DISPLAY"
Or something more sensible like:
image/gif; xdg-open -t image/gif '%s'; test=test -n "$DISPLAY"
image/png; xdg-open -t image/png '%s'; test=test -n "$DISPLAY"
The remaining problem is defining the priority of such entries compared
to entries inserted by packages still supporting mailcap.