Copied from brave/browser-laptop#15323 by @Kallestofeles
Cannot set Brave as the default browser in Arch linux. Set as default option does nothing.
System:
Kernel: 4.19.4-zen1-1-zen x86_64 bits: 64
Desktop: Gnome 3.30.2
Distro: Arch Linux
Brave Version 0.56.15 Chromium: 70.0.3538.110 (Official Build) unknown (64-bit)
+1 from Community:
https://community.brave.com/t/various-bugs-on-arch-or-manjaro-linux/38521/2
I solved this problem manually setting xdg configs:
xdg-mime default brave.desktop x-scheme-handler/http
xdg-mime default brave.desktop x-scheme-handler/https
Thanks but does not work.

The issue is not that Brave was not the default browser - it is! It handles all the requests as it should, however every time the browser gets opened, it shows this set as default message + set as default from the settings does not work. The issue essentially is only cosmetic but annoying as hell as it pops up every time the browser is opened.
could you try this:
xdg-settings set default-web-browser brave-bin.desktop
next query if the operation was successfull:
xdg-settings check default-web-browser brave-bin.desktop
xdg-settings check default-web-browser brave.desktop returns yes but Brave still shows it's not the default browser. xdg-open opens Brave as it should.
tested here,
-setting other browser (for instance, opera) as default: xdg-settings set default-web-browser opera.desktop
-going back to brave: after setting brave as default browser by xdg-settings, the message appears, but closing it (x) does the trick, it does not pop up again.
But if I click "make default" in brave settings, the pop up is called again.
so, close the pop up by (x) and not clicking "set as default"
I think that the next step in debugging this is working out how Arch is doing defaults/handlers differently from other distros so that we can detect and support that.
Confirmed this is happening on KDE Neon as well. I don't think this is an OS problem, rather a problem with how Brave is self-detecting if it's the default or not.
The erroneous "Set as Default" dialog is still happening on Arch.
Brave: Version 0.61.51 Chromium: 73.0.3683.75 (Official Build) unknown (64-bit)
Linux 5.0.4-arch1-1-ARCH #1 SMP PREEMPT Sat Mar 23 21:00:33 UTC 2019 x86_64 GNU/Linux
Brave is set as the default for .html, http and https, but the dialog still pops up...
What is the output of ls -l /etc/alternatives/x-www-browser?
Does making Brave the default using update-alternatives --config x-www-browser make the message go away?
@fmarier not sure Arch has update-alternatives. I believe that is a Debian-based thing
I also saw update-alternatives on Fedora and so I assumed it was a standard Linux thing. Though looking at it closer, while it exists on Fedora, there is no /etc/alternatives/x-www-browser.
So I think you're right, that last part looks like a Debian-specific thing.
For the ones like me who manually set Brave as default but were tired of the popup at every startup: just click the X instead of "Set as default".
Took me almost a week to realize this :)
EDIT. I also realized it was already been said some comments up here: https://github.com/brave/brave-browser/issues/2377#issuecomment-445977000
Similar to @helionmelion
I had to set it manually using xdg
xdg-settings set default-web-browser brave-bin.desktop
Note brave.desktop did not work as I installed brave-bin from AUR.
If you want to see what is current the default browser in xdg use xdg-settings get default-web-browser
Similar to @helionmelion
I had to set it manually using xdg
xdg-settings set default-web-browser brave-bin.desktop
Notebrave.desktopdid not work as I installedbrave-binfrom AUR.If you want to see what is current the default browser in xdg use
xdg-settings get default-web-browser
Yes I'm using the aur version now.
xdg-settings get default-web-browser
brave-beta-bin.desktop
I can confirm that this is still a problem in Arch with Gnome 3.32.2 and kernel 5.2.2-arch1-1-ARCH. I have set Brave as the default browser in the Gnome Control Center as well as run the following commands, without luck:
xdg-mime default brave-bin.desktop x-scheme-handler/http
xdg-mime default brave-bin.desktop x-scheme-handler/https
xdg-settings set default-web-browser brave-bin.desktop
Running xdg-settings check default-web-browser brave-bin.desktop returns yes
Running xdg-settings get default-web-browser returns brave-bin.desktop
Running xdg-open "https://duckduckgo.com" opens https://duckduckgo.com in Brave
Clicking Make Default in the settings or on the popup does not help.
Clicking the X on the popup does not disable the popup.
I tried to set brave as my default browser using xdg-settings
$ xdg-settings set default-web-browser brave.desktop
but Brave was still showing the pop-up, so after clicking on "Set as default" I checked:
$ xdg-settings get default-web-browser
brave-browser.desktop
$ xdg-settings check default-web-browser brave-browser.desktop
no
So I thought, well maybe Brave is expecting the executable to be called brave-browser and not brave hence when I click on "Set as default" it's setting the wrong entry? So I aliased brave-browser to brave in my .bashrc:
alias brave-browser=brave
opened Brave, clicked on "Set as default". Logged out of my user and back in to check if it worked and the pop-up was gone!
Also now xdg-settings is showing
$ xdg-settings check default-web-browser brave-browser.desktop
yes
Hope this helps.
alias brave-browser=brave
Interesting. I wonder whether that's something that the Brave maintainer in Arch could add to the package.
I figured it out,
You need to set the HTML default application to Brave for the popup to stop appearing
(Tested with KDE only, on Arch Linux)
You can also just click the 'x' instead of 'Set as Default' and the popup will stop appearing
Using sudo was the way I fixed it:
517 sudo xdg-settings set default-web-browser brave.desktop
518 brave http://archlinux.org/
Randomly tried all these, all of them failed:
502 xdg-settings set default-web-browser brave.desktop
503 xdg-open http://archlinux.org/
504 xdg-settings set default-web-browser brave.desktop
505 xdg-open http://archlinux.org/
507 xdg-settings set default-web-browser firefox.desktop
508 xdg-open http://archlinux.org/
509 xdg-open http://archlinux.org/
510 xdg-mime default brave.desktop x-scheme-handler/http
511 xdg-mime default brave.desktop x-scheme-handler/https
512 xdg-open http://archlinux.org/
513 xdg-settings set default-web-browser brave-bin.desktop
514 xdg-open http://archlinux.org/
515 brave http://archlinux.org/
516 brave-bin http://archlinux.org/
On Debian 9 x64 (using i3wm) nor xdg-settings neither xdg-mime don't even worked (even when outputing 0).
To solve the problem I had to manually edit ~/.config/mimeapps.list
It's dirty but it works !
[Default Applications]
x-scheme-handler/http=brave.desktop
x-scheme-handler/https=brave.desktop
x-scheme-handler/ftp=brave.desktop
x-scheme-handler/chrome=brave.desktop
text/html=brave.desktop
application/x-extension-htm=brave.desktop
application/x-extension-html=brave.desktop
application/x-extension-shtml=brave.desktop
application/xhtml+xml=brave.desktop
application/x-extension-xhtml=brave.desktop
application/x-extension-xht=brave.desktop
Possible work-around for Arch Linux, courtesy of https://github.com/brave/brave-browser/issues/11032#issue-669481089:
ln -s ~/.config/mimeapps.list ~/.local/share/applications/mimeapps.list
Most helpful comment
could you try this:
xdg-settings set default-web-browser brave-bin.desktopnext query if the operation was successfull:
xdg-settings check default-web-browser brave-bin.desktop