[sway] xdg-settings set default-web-browser firefox.desktop didn't change the default-web-browser value, why?


I’m run on Fedora 37 + Sway (my dotfiles).

I would like to configure Firefox as my default browser. When I click on url links in Signal, Mattermost, Slack… I would like open the page in Firefox and not in Chrome.

I have reading this page xdg-utils - ArchWiki

I have executed:

$ xdg-settings --list
Known properties:
  default-url-scheme-handler    Default handler for URL scheme
  default-web-browser           Default web browser

$ xdg-settings get default-web-browser

$ xdg-settings set default-web-browser firefox.desktop

$ xdg-settings get default-web-browser

Why xdg-settings set ... didn’t update the default-web-browser value? Where is my mistake?

Best regards,

Did you logout in between checking?

  1. How is Firefox installed? dnf / rpm package, flatpak, …

  2. Is your Firefox desktop file actually named firefox.desktop?

    $ locate -i '*firefox*.desktop'
  3. What is the value of XDG_CURRENT_DESKTOP?


Different DEs handle settings differently, so xdg-settings has to implement a lot of DE-specific code. It doesn’t appear to have specific support for sway yet, so it will fall back to a generic way. I don’t know anything about sway; it might not work with xdg-settings (or vice versa).

$ grep '^set_browser' /usr/bin/xdg-settings
$ grep -i sway /usr/bin/xdg-settings # no results

If user settings cannon be applied, some of the configs may have incorrect ownership.
Make sure all files/dirs in your home are owned by your UID/GID:

sudo chown -R $(id -u):$(id -g) ~