Hi Allan,

Sorry for the long delay in replying :-(

Den 2015-06-05 kl. 06:25, skrev Allan Wind:
> Dear Maintainer,
> 
> I tried to open a link in Pidgin which was configured to use the browser
> Desktop Default.  Instead of using Iceweasel as expected it opened the link in
> Chrome.   Checked on update-alternatives and I have iceweasel as my 
> preference.
> Then I tried to check on xgd-settings which was unhelpful:
> 
> allan@vent:~$ xdg-settings get default-web-browser
> xdg-settings: unknown desktop environment
> 
> Maybe use the same logic as xdg-open which has:
> 
> detectDE
> 
> if [ x"$DE" = x"" ]; then
>     DE=generic
> fi
> 
> Although maybe defectDE should just return generic?  There are many copies of
> this function it seems.  I run xmonad without a desktop environment.

Indeed, I will fix it.

> Downloaded the Pidgin source to figure out that it calls xdg-open.  The man
> page for xdg-open is unhelpful to figure out where it is getting that setting
> from so I traced the script to figure out that it calls `xdg-mime query 
> default
> x-scheme-handler/http`.  The man page for xdg-mime is unhelpful to figure out
> where it gets its information from, so I trace that script to finally find the
> source as /usr/share//applications/defaults.list.  To me it is weird that a
> configuration file lives in /usr/share.

The reference for these kinds of things are the freedesktop.org
specifications. I should add references to them in the manual page. Here
they are anyway:

Default applications and associations:
http://standards.freedesktop.org/mime-apps-spec/mime-apps-spec-latest.html

Base directories:
http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html

> The defaults.list file contains no references to Iceweasel, so not sure if
> Iceweasel should populate that file.  It didn't, btw, when I reconfigured 
> iceweasel.

Actually, the correct file is mimeapps.list. Recent versions of
Iceweasel should populate ~/.config/mimeapps.list if you press the "Make
default" button. Due to a bug in xdg-utils it does not actually check
~/.config/mimeapps.list, but it will in my next upload.

> I noticed that xgd-open sets the BROWSER variable to what seems most sensible:
> 
> BROWSER=x-www-browser:firefox:seamonkey:mozilla:epiphany:konqueror:chromium-browser:google-chrome:www-browser:links2:elinks:links:lynx:w3m
> 
> but then never used.  I already configured my system preference with
> x-www-browser so xdg-open should really consult that data source.

I'm not sure. The user might have configured the default choice in other
ways. For example, he/she might have clicked "Make default" in Iceweasel
or used "xdg-mime default". In these cases, running x-www-browser would
be confusing.

Since version 1.1.0~rc3+git20150919-1 xdg-open will use what you specify
in your $BROWSER environment variable if you set it (and if running in
generic mode). So if you set BROWSER=x-www-browser then you should get
your preferred browser.

> Shouldn't xdg-mime have an easy way to query its entire database?  I would 
> have
> zero chance of guessing that I needed to configure x-scheme-handler/http, or
> the rest of them.

Could be a good idea, yes. Although you shouldn't have to guess really.

> Anyways, feel free to down-prioritize, I am probably the rare exception 
> running
> without a desktop environments, and split what would be helpful to individual
> tickets.

No, you're not an exception. I appreciate your feedback.

-- 
Pelle

Reply via email to