On Tue, 08 Jan 2019 at 13:20:14 +0100, Bastien ROUCARIES wrote: > I could add a sensible-x-www-browser to be more nice to our user to > sensible-utils
Please use xdg-open instead of reinventing it. Unlike the alternatives system, xdg-open respects the per-user configuration written by our default GNOME desktop (and hopefully other desktop environments), which should be a good way to avoid users getting unexpected behaviour ("I configured Firefox to be my default browser, why do I get Chromium?" or similar). Unlike the use of $BROWSER in sensible-browser, it doesn't require setting an environment variable, which only relatively Unix-literate users are going to be able to do. Unlike sensible-browser, it's non-Debian-specific and can be recommended to upstream developers without having to say "... but this only works on Debian". In a GNOME environment, xdg-open uses `gio open`, which uses the configured freedesktop.org default handler for the x-scheme-handler/http or x-scheme-handler/https pseudo-MIME-types. Those default handlers in ~/.config/mimeapps.list are what GNOME sets when you change the default web browser, and also what Firefox sets when you tell it to make itself the default. None of this is GNOME-specific or Debian-specific (`gio` is a GLib tool, so it's more closely related to GNOME-derived desktop environments, but it's looking at a cross-desktop source of configuration), so I would hope that any/all desktop environments can implement it. In a "generic" environment, xdg-open seems to reimplement essentially the same logic that GLib uses, including the x-scheme-handler/foo pseudo-MIME-types. In non-GNOME environments that it recognises (KDE, DDE, MATE, Xfce, etc.) I don't know the specifics of what xdg-open does, but if they're wrong, that's a bug in xdg-open or the tools/libraries that it uses, and should be fixed. smcv