How do I change the default browser that konsole opens URLs with?

I ran into this problem running konsole in Ubuntu/Unity. When everything else failed, I edited ~/.kde/share/config/kdeglobals:

[General]
BrowserApplication[$e]=!google-chrome

Logout, login -- bingo!


The problem with "default applications" nowadays is that different programs look for the defaults in different ways. What we can call the traditional approach is $BROWSER and mailcap files.

But, recently, many graphical programs have started relying on .desktop files, and there is a set of xdg-* tools devoted to manipulate and retrieve some of the defaults.

Try:

xdg-settings get default-web-browser

If this shows konqueror, then

xdg-settings set default-web-browser google-chrome.desktop

Should fix it, at least if the xdg-settings documentation is to be trusted.

Now, all that xdg-settings does is talking with the currently running desktop environment, so this should be GNOME, and it should be already set to google-chrome...


This is the correct behavior of Konsole. It opens links in the KDE default browser. If no browser is specified, it will launch Konqueror. Since you could not find any mentioning of Konqueror in the configuration files, the latter is exactly your case.

To set your preferred browser do the following (I assume that your Konsole and Konqueror are from KDE4):

  • open KDE System Settings (e.g. by launching Kcontrol)
  • navigate to Default Applications (it must be somewhere under "Workspace Appearance")
  • find the Web Browser section
  • write the [path and] name of your preferred browser

Hope this helps.