Choose default browser

When trying to change default web browser on linux distros, it can be a mess…

Too many different options and nobody knows the right one. And for a reason: there are several, depending on which app you are talking about.

Here is what you need to do:

The obvious one is:

~$ sudo update-alternatives --config x-www-browser
There are 3 choices for the alternative x-www-browser (providing /usr/bin/x-www-browser).
Selection Path Priority Status
------------------------------------------------------------
0 /usr/bin/vivaldi-stable 200 auto mode
1 /usr/bin/chromium-browser 40 manual mode
* 2 /usr/bin/firefox 40 manual mode
3 /usr/bin/vivaldi-stable 200 manual mode
Press to keep the current choice[*], or type selection number:

But don’t forget this one !

There are 3 choices for the alternative gnome-www-browser (providing /usr/bin/gnome-www-browser).
Selection Path Priority Status
------------------------------------------------------------
0 /usr/bin/vivaldi-stable 200 auto mode
1 /usr/bin/chromium-browser 40 manual mode
* 2 /usr/bin/firefox 40 manual mode
3 /usr/bin/vivaldi-stable 200 manual mode
Press to keep the current choice[*], or type selection number:

Now this should work… but we often miss this poorly documented one:

~$ xdg-settings get default-web-browser
chromium.desktop
~$ xdg-settings set default-web-browser firefox.desktop

When I say poorly documented, I mean you read the manual and you do not find the location of the configuration file involved (with strace you find out that it is $HOME/mimeapps.list).

Moreover, here is what you read:

Check whether the default web browser is firefox.desktop, which can be false even if « get default-web-browser » says that is the current value (if only some of the underlying settings actually reflect that value)

That’s it: one single distro, three (complicated, non self explained) options, poor documentation. This is why systemd folks won that battle, there IS a need for one standard, even if it’s bad, it will get better over time.

Laisser un commentaire

Votre adresse e-mail ne sera pas publiée. Les champs obligatoires sont indiqués avec *

Ce site utilise Akismet pour réduire les indésirables. En savoir plus sur comment les données de vos commentaires sont utilisées.