[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Changing default XDB browser w/o GNOME etc.



Hallo,
* Martin Read [Sun, Dec 13 2015, 11:18:24AM]:
> On 13/12/15 09:19, Eduard Bloch wrote:
> >Observation: various programs use the XDG mechanism (freedesktop
> >configuration method) to start a specific browser to visit a hyperlink.
> >Easy to verify with the xdg-open tool.
> >
> >But how can I change this setting in a persistent way especially when I
> >don't use Gnome or Kde or Xfce? I tried LxQt once and apparently the
> >stupid thing has reset some configuration and now xdg-open starts
> >Qupzilla which I don't like. Before, some other stupid program has reset
> >it to Chromium which I don't like either.
> 
> xdg-open examines your environment to determine what desktop environment (if
> any) you are invoking it under, and follows a DE-specific strategy if you're
> using one of the DEs it knows about (KDE, LXDE, XFCE, Gnome, Darwin, MATE).
> This is an entirely reasonable design decision, but also one that reasonable
> people can disagree with.

I didn't realize that it's plain shell script, thanks for mentioning
this below. I haven't even checked because I assumed that it's a program
using the common glib/kde framework functions to run url/mime handlers.

> If you are not using one of the desktop environments it knows about, then it
> uses its "generic" approach. For HTTP URLs, the generic approach is "check
> the BROWSER environment variable, then try the web browsers in a specified
> order if BROWSER isn't set". The first entry in that ordering is www-browser
> if DISPLAY is not set, and x-www-browser if DISPLAY *is* set.

What you describe is exactly what the sensible-browser script does. And
sensible-browser works fine for me, xdg-open does not.

What happens for me is that sensible-browser runs x-www-browser
(pointing at iceweasel) but xdg-open seems to try different fallbacks
first and finds some mime information about for http in
/usr/share//applications/mimeinfo.cache (not ok).

But anyhow, thanks for mentioning BROWSER variable. It seems to
influence glib functions too, so it's just what I need.

> xdg-open is written in POSIX shell, so you could easily copy it into a
> higher-priority location in your particular user account's PATH and modify
> it.

I will try to communicate this with the xdg-utils maintainer.
IMHO the script should respect the specifics of a system and on Debian
consider the configuration of x-www-browser alternative entry rather if
it couldn't detect a specific desktop environment. Or maybe do so only
if the alternative-link is a non-default setting.

Best regards,
Eduard.


Reply to: