Default browser not respected by uLauncher and Manjaro hello

KDE Plasma v5.20.5
Kernal 5.10.15-1
Default browser - Brave

I have a minor but intriguing issue with my default browser.

I recently started using Ulauncher and noted that web searches initiated from the launcher are sent to Firefox rather than my default browser Brave. After exhausting support options for Ulauncher I had decided to move on and ignore the issue. However I have since found that any links from the Manjaro Hello application are also going to Firefox. Uninstalling Firefox got around the issue but it returned when Firefox was reinstalled.

Searches performed from Krunner open in the default browser.

Things I have done to investigate:

  1. Ensured that Brave is the default in System Settings - Default Applications

  1. Terminal

xdg-settings get default-web-browser

Returns - brave-browser.desktop

xdg-mime query default x-scheme-handler/https

Returns - brave-browser.desktop


Opens in Brave as expected

  1. Suggestions from other forum posts

xdg-mime default brave-browser.desktop x-scheme-handler/http

xdg-mime default brave-browser.desktop x-scheme-handler/https

  1. Suggestion from Ulauncher forum

python -c “import subprocess; subprocess.Popen([‘xdg-settings’, ‘get’, ‘default-web-browser’])”

Returns - brave-browser.desktop

This is not a major issue for me but I would like to solve it even if only for the educational value.

Thanks in advance

With manjaro-hello the python library webbrowser is used.

From the docs of the webbrowser library there is a mention of the environment variable $BROWSER which the library will use if present. If the value is not present the library supposedly uses the default for the environment but if it cannot locate one it will use a predefined list - which lists mozilla and firefox as the first two - which then explains why it is firefox that launches in your case :slight_smile:

Check which value it has - if any

$ echo $BROWSER

Set a value e.g. brave-browser assuming this is the name of the binary

$ BROWSER=brave-browser

You can set the value on a permanent base using ~/.profile

export BROWSER=brave-browser
1 Like

Thanks for taking the time to reply.

Unfortunately I haven’t managed to fix it based on your suggestions.

As expected the BROWSER environment variable was set to /usr/bin/firefox

I can change the variable either temporarily or persistently through ~/.profile and echo $BROWSER reflects the change. However links in Manjaro Hello still open in Firefox.

As I said before, this isn’t a major issue and it has prompted me to learn a little more about environment variables.

Thanks again for your time.

The fix for this in KDE/Plasma is to edit the file, /etc/xdg/plasma-workspace/env/ , as it’s what’s making $BROWSER always be Firefox.