25

In Ubuntu I used

sudo update-alternatives --config x-www-browser

to set the default internet browser manually.

enter image description here

In Manjaro I get:

sudo: update-alternatives: command not found

I have set Firefox as the default in its settings and want it to stay so.

After installing Chromium, the default browser is now Chromium, although I reconfirmed Firefox as such and in Chromnum settings it says: "Chromium cannot determine or set the default browser".

How to make Firefox default browser?

  • Does manjaro have the x-www-browser symlink? And to what it links? Also, is update-alternatives available in Manjaro? – Braiam Oct 08 '15 at 12:21
  • @Braiam - No. And no, not even in AUR. –  Oct 08 '15 at 15:20
  • If your system doesn't have `x-www-browser`, what is “changing the linked binary” supposed to mean? Are you trying to change the default browser? That depends on the application that launches it — I don't think Manjaro has a system-wide default (and it's more of a user preference anyway). What application are you interested in? – Gilles 'SO- stop being evil' Oct 08 '15 at 22:58
  • @Gilles - that phrasing of the title is due to the edit made by [Braiam](http://unix.stackexchange.com/users/41104/braiam), while I was just asking out of curiosity thinking that the ubuntu option would be available in Manjaro. If not, that's my answer. (Installing Chromium, it took over as default browser. I think I fixed it simply from the FF GUI.) –  Oct 09 '15 at 07:09
  • 1
    @cipricus Oh, I see, sorry. Your original title was [misleading](http://meta.stackexchange.com/questions/66377/what-is-the-xy-problem) too. Once again, I don't think Manjaro has a system-wide or per-user default, so you'll get better help if you mention which applications you use that launch a browser. – Gilles 'SO- stop being evil' Oct 09 '15 at 09:47
  • @Gilles - I have now edited the question to fit the new title, which is basically what I want. –  Oct 09 '15 at 09:54

7 Answers7

26

For users of i3wm, in addition to editing ~/.config/mimeapps.list and ~/.i3/config, you also need to change $BROWSER from ~/.profile, set it to /usr/bin/chromium, to prevent browser sessions emerging from the terminal from opening the wrong browser.

Ébe Isaac
  • 319
  • 4
  • 15
Anas Harby
  • 361
  • 3
  • 2
  • 6
    Actually, I find that this is the *only* solution that solved my problem. This *is* a separate answer. For applications that open the default browser (such as Jupyter) changing just the key bindings won't work. – Ébe Isaac May 11 '18 at 07:01
  • for me removing the palemoon package was also required `pacman -R palemoon-bin` – akiva Feb 24 '19 at 21:42
20
xdg-settings set default-web-browser chromium.desktop
Niklas Siefke
  • 301
  • 2
  • 8
  • 2
    Where `chromium` is whatever you'd type at the command prompt to start your preferred browser. Eg, it could be `google-chrome-stable`. – Tom Hale May 27 '17 at 07:16
  • Works for voidlinux with i3. – xoryves Jun 07 '18 at 08:30
  • 4
    Does not work on Manjrao I3: `xdg-settings: $BROWSER is set and can't be changed with xdg-settings`, but Anas answer worked: https://unix.stackexchange.com/a/434465/28262 – Florian Brinker Nov 20 '18 at 15:43
  • For Google Chrome, I had to use `xdg-settings set default-web-browser google-chrome.desktop`. `xdg-settings set default-web-browser google-chrome-stable` gave a *xdg-settings: invalid application name* error; using the full path for *google-chrome-stable* gave the same error. – apaderno Aug 09 '20 at 07:25
14

This question is a bit old, but I would like to register my solution. After struggling with xdg-settings, what worked for me was xdg-mime.

So, check your default browser with:

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

And change whatever browser you want to use. Make sure you use the .desktop after the browser name.

xdg-mime default google-chrome.desktop x-scheme-handler/https
xdg-mime default google-chrome.desktop x-scheme-handler/http

Then, check again:

xdg-mime query default x-scheme-handler/https
AdminBee
  • 21,637
  • 21
  • 47
  • 71
Karlo Guidoni
  • 241
  • 2
  • 4
  • 1
    Of course, nothing else worked for me. Do you know in which files this configuration is kept ? For me .config/mimeapps.list contained chrome even before xdg-mime... – Andrei Boyanov Jul 20 '20 at 13:18
  • 1
    I think mimeapps.list is the default config file for this. Look for this file in other locations. See examples [here](https://wiki.archlinux.org/index.php/XDG_MIME_Applications#mimeapps.list) – Karlo Guidoni Jul 21 '20 at 12:02
  • Confirmed working on latest install of manjaro when opening webpage links directly from terminal and in intellij. – li x Sep 11 '20 at 09:04
  • This is the best-working answer. I installed brave after having fiddled with mimeapps.list , where I already had set chromium as my default. Brave took over being the default, despite all the entries in mimeapps.list, but this set it back to chromium – transient_loop Nov 25 '20 at 17:41
6

Edit your ~/.config/mimeapps.list and replace references to firefox.desktop with google-chrome.desktop.

If you use google-chrome-stable to launch chrome, use that instead, followed by .desktop.

Tom Hale
  • 28,728
  • 32
  • 139
  • 229
5

In case someone else has the same issue…

Edit your config file:

nano ~/.i3/config 

and change

bindsym $mod+F2 exec …

to your browser of choice (e.g. bindsym $mod+F2 exec google-chrome-stable) Save and reload your config file (mod+Shift+R)

Should be all set…

phk
  • 5,893
  • 7
  • 41
  • 70
chris.r
  • 71
  • 1
  • 3
2

I tried most of the answers in here. This is what I ended up doing

sudo pacman -R firefox

Just removed firefox. If I install firefox again with sudo pacman -S firefox it sets as default again so annoying.

Tono Nam
  • 268
  • 2
  • 4
0

If you are using i3 with Palemoon pre-installed and want to replace it with a cooler browser, like brave:

Please edit ~/.config/mimeapps.list and replace references to Moon.desktop with brave.desktop.

To easily replace all the Moon cases to brave in the mimeapps.list file with vim, use :%s/Moon/brave/gc and answer yes to each case.