Define and set default browser.

List known properties.

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

Display default browser.

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

Display available browsers.

$ grep --files-with-matches "Web Browser" /usr/share/applications/*.desktop | xargs -I{} basename {}
firefox.desktop
google-chrome.desktop
start-librewolf.desktop

Display LibreWolf desktop file.

$ cat /usr/share/applications/start-librewolf.desktop
[Desktop Entry]
Type=Application
Name=LibreWolf
GenericName=Web Browser
# Gnome and KDE 3 uses Comment.
Comment=Web Browser
StartupNotify=true
Terminal=false
Type=Application
MimeType=application/json;application/pdf;application/rdf+xml;application/rss+xml;application/xhtml+xml;application/xhtml_xml;application/xml;image/gif;image/jpeg;image/png;image/webp;text/html;text/xml;x-scheme-handler/http;x-scheme-handler/https;
Comment=LibreWolf Browser
Categories=Network;WebBrowser;Security;
StartupWMClass=librewolf-default
Exec=/usr/share/librewolf/librewolf %u
Icon=/usr/share/librewolf/browser/chrome/icons/default/default64.png

Actions=new-window;new-private-window;safe-mode;preferences;

[Desktop Action new-window]
Name=New Window
Exec=/usr/share/librewolf/librewolf
[Desktop Action new-private-window]
Name=New Private Window
Exec=/usr/share/librewolf/librewolf --private-window %u
[Desktop Action safe-mode]
Name=Start in Safe Mode
Exec=/usr/share/librewolf/librewolf --safe-mode
[Desktop Action preferences]
Name=Show Preferences
Exec=/usr/share/librewolf/librewolf --preferences

Define custom LibreWolf desktop application (based on Firefox desktop file).

$ sudo tee /usr/share/applications/librewolf.desktop <<EOF
[Desktop Entry]
Version=1.0
Name=LibreWolf
GenericName=Web Browser
Comment=Access the Internet
Exec=/usr/bin/librewolf %U
StartupNotify=true
Terminal=false
Icon=librewolf
Type=Application
Categories=Network;WebBrowser;
MimeType=application/pdf;application/rdf+xml;application/rss+xml;application/xhtml+xml;application/xhtml_xml;application/xml;image/gif;image/jpeg;image/png;image/webp;text/html;text/xml;x-scheme-handler/http;x-scheme-handler/https;
Actions=new-window;new-private-window;

[Desktop Action new-window]
Name=Open a New Window
Exec=/usr/bin/librewolf -new-window

[Desktop Action new-private-window]
Name=Open a New Private Window
Exec=/usr/bin/librewolf -private-window
EOF
[Desktop Entry]
Version=1.0
Name=LibreWolf
GenericName=Web Browser
Comment=Access the Internet
Exec=/usr/bin/librewolf %U
StartupNotify=true
Terminal=false
Icon=librewolf
Type=Application
Categories=Network;WebBrowser;
MimeType=application/pdf;application/rdf+xml;application/rss+xml;application/xhtml+xml;application/xhtml_xml;application/xml;image/gif;image/jpeg;image/png;image/webp;text/html;text/xml;x-scheme-handler/http;x-scheme-handler/https;
Actions=new-window;new-private-window;

[Desktop Action new-window]
Name=Open a New Window
Exec=/usr/bin/librewolf -new-window

[Desktop Action new-private-window]
Name=Open a New Private Window
Exec=/usr/bin/librewolf -private-window

Set LibreWolf as default browser.

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

Check whether Firefox is default browser.

$ xdg-settings check default-web-browser firefox.desktop
no

Check whether LibreWolf is default browser.

$ xdg-settings check default-web-browser librewolf.desktop
yes

Display default browser.

➜ xdg-settings get default-web-browser
librewolf.desktop
ko-fi