How do I change the default browser that konsole opens URLs with?
Solution 1
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!
Solution 2
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
...
Solution 3
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.
Solution 4
You can easily do this using 'Default Applications'. Simply search the name in the start menu to find the window.
Solution 5
The right way for me to make this work in ubuntu 18.04 was to add
[General]
BrowserApplication[$e]=!put-your-favorite-browser-here
to ~/.config/kdeglobals
as suggested here. After that you only need to start a new konsole.
Related videos on Youtube
Ben Middleton
Updated on September 18, 2022Comments
-
Ben Middleton almost 2 years
I have google-chrome set as my default web browser in Ubuntu and gnome applications. However, when using konsole, all links open in konqueror, and not google-chrome!
I've tried setting the default browser with:
sudo update-alternatives --config 'x-www-browser'
This works for opening links in gnome-terminal, and other gnome programs... but not kde ones like konsole. Also, there appears to be no kcontrol program for accessing the kde settings.
Does anyone know a way to set the kde setting for this while still using gnome?
EDIT: From what I can tell, I've got all the related settings configured that I can think of...
grep 'chrome' ~/.local/share/applications/mimeapps.list x-scheme-handler/http=google-chrome.desktop;firefox.desktop; x-scheme-handler/https=google-chrome.desktop;firefox.desktop; x-scheme-handler/http=google-chrome.desktop x-scheme-handler/https=google-chrome.desktop x-scheme-handler/chrome=firefox.desktop text/html=google-chrome.desktop application/x-extension-htm=google-chrome.desktop;firefox.desktop; application/x-extension-html=google-chrome.desktop;firefox.desktop; application/x-extension-shtml=google-chrome.desktop;firefox.desktop; application/xhtml+xml=google-chrome.desktop;firefox.desktop; application/x-extension-xhtml=google-chrome.desktop;firefox.desktop; application/x-extension-xht=google-chrome.desktop;firefox.desktop; x-scheme-handler/about=google-chrome.desktop x-scheme-handler/unknown=google-chrome.desktop grep 'chrome' /usr/share/applications/defaults.list text/html=firefox.desktop;google-chrome.desktop text/xml=firefox.desktop;google-chrome.desktop application/xhtml_xml=google-chrome.desktop x-scheme-handler/http=firefox.desktop;google-chrome.desktop x-scheme-handler/https=firefox.desktop;google-chrome.desktop x-scheme-handler/ftp=google-chrome.desktop
And there are no references to konqueror:
grep -i 'konqueror' /usr/share/applications/defaults.list grep -i 'konqueror' ~/.local/share/applications/mimeapps.list grep -i 'kon' /usr/share/applications/defaults.list grep -i 'kon' ~/.local/share/applications/mimeapps.list
-
Nemo almost 13 yearsTry exporting BROWSER variable.
export BROWSER=google-chrome
-
Ben Middleton almost 13 years@Capt.Nemo : Hmm... still opens with Konqueror
-
muhuk over 12 yearsI have the same problem with Debian Squeeze.
-
phil294 about 7 yearsi dont know why, but I have another
mimeapps.list
at~/.config
-
-
Ben Middleton over 12 yearsHmm... very strange. I look in those files and I've got no references to konqueror at all. Instead, for all the html & xhtml related mimetypes, it's set to firefox & chrome. Note that I've tried with both "Konqueror" and the "Yakuake" terminal which appears to use Konsole underneath. @Jorge Castro: See my edited question above for the applicable settings I have in these files.
-
Aquarius Power over 7 years@TrinitronX the executable is now
systemsettings
(packagename the same) -
Aquarius Power over 7 yearsit was opening a zip file in GEdit (buggy of course)!!! see here: askubuntu.com/questions/896564/…
-
Ben Middleton over 6 yearsAlthough njsg's answer did work for the most part to fix default browser when performing many actions which launch it on the desktop. It appears that
konsole
and apps which use it such asyakuake
look for this setting in~/.kde/share/config/kdeglobals
. After reviving the old system plagued by this issue, I can accept this answer with confidence! -
Ivan Kozik over 6 yearsI had to add this to ~/.config/kdeglobals instead.
-
MattBoothDev over 6 yearsI come here on Ubuntu 16.04 using Yakuake and this was the answer I needed in order to open links from within the console (Yakuake/Konsole) through Chrome.
-
Michael Franzl almost 6 yearsThis answer worked for me. Newer KDE versions even allow you to select from installed browsers via a dropdown menu. Konsole then uses the selected browser.
-
Sina over 5 yearsIf you use chromium rather than chrome use "chromium-browser" rather than "google-chrome"
-
andrybak about 5 yearswhat does the exclamation mark
!
signify? -
Natetronn almost 4 years@andrybak I'm not 100% sure but, I think it signifies it's a command. There is no
!
when using google-chrome.desktop, for example. I'm wondering what[$e]
means, however, as it's not added to this line when I use the system settings in Manjaro to set the default browser.