How to change default browser for whole system?

Because I wanted to switch to BTRFS for all my systems I re-installed my laptop, I create an ISO with build-tools (KDE Full, Kernel5.4) and fired that up. System is working fine besides a few issues/question.

I would like the default browser for the system to be: Chrome , not firefox.
After some googling I was able to change it for my own user account. This post helped. This is what I did:

  • kcmshell5 componentchooser (changed it to chrome)
  • Added BROWSER="/usr/bin/google-chrome-stable" to .zshrc
  • xdg-mime default google-crhome.desktop x-scheme-handler/http
    xdg-mime default brave-browser.desktop x-scheme-handler/https

All works fine. I am a happy camper. But this system is connected to my LDAP server. So each time a family member logs in for the first time , he/she will have to do the same thing. So would like to change this on a system level, not per user.

How can I do this?
(did a find in /usr/share: sudo find . -type f ! -path "./doc/*" -exec grep -l "firefox" {} \; without much of a result.)

According to the Arch Wiki and the Association between MIME types and applications, system-wide settings for default applications can be set in the file /etc/xdg/mimeapps.list (or $XDG_CONFIG_DIRS/mimeapps.list).

Create the file if it doesn’t exist, open it with a text editor and add manually the entries you wish. For example:

[Default Applications]
x-scheme-handler/http=google-chrome-stable.desktop
x-scheme-handler/https=google-chrome-stable.desktop

Take notice that user defined settings in the ~/.config/mimeapps.list file have higher priority for the specific user than the ones set in /etc/xdg/mimeapps.list.

2 Likes

Thanks for pointing me to that folder, I changed:

/etc/xdg/plasma-workspace/env/envars.sh
/etc/xdg/kde-mimeapps.list
/etc/xdg/kdeglobals

and removed all traces of firefox and replaced them (and replaced nano by vi in the process :wink: )

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.