Changing the default web browser

Before I go on a kinda rant: Is there a simple way of doing this I am just not seeing? (I found a solution…but it’s 4 years old and kind of buried)

This seems like something that should be in Rani/Welcome right under choosing my default shell. (yay! fish! I was an instant fanboy after discovering that)

More current note to self on the only working solution I found:

xdg-mime default <YOURBROWSERHERE>.desktop x-scheme-handler/https
xdg-mime default <YOURBROWSERHERE>.desktop x-scheme-handler/http

On fresh install .config/mimeapps is effectively empty. I still have no clue where firedragon was persisting, no matter how I set BROWSER or used xdg-settings

System:
  Kernel: 6.13.7-zen1-1-zen arch: x86_64 bits: 64 compiler: gcc v: 14.2.1
    clocksource: tsc avail: hpet,acpi_pm
    parameters: BOOT_IMAGE=/@/boot/vmlinuz-linux-zen
    root=UUID=7dd55af1-89d4-4559-8635-ecd7bcb0728c rw rootflags=subvol=@
    quiet loglevel=3 pci=noaer pci_aspm=off ibt=off
  Desktop: Sway v: 0.5 with: waybar tools: swayidle avail: gtklock,swaylock
    vt: 1 lm: greetd Distro: Garuda base: Arch Linux
Machine:
  Type: Mini-pc System: Micro (HK) Tech product: Venus series v: F7BSD_V1.0
    serial: <superuser required>
  Mobo: Shenzhen Meigao Equipment model: F7BSD v: F7BSD_V1.0
    serial: <superuser required> uuid: <superuser required> UEFI: American
    Megatrends LLC. v: 1.00 date: 10/10/2023
CPU:
  Info: model: AMD Ryzen 7 7840HS w/ Radeon 780M Graphics bits: 64
    type: MT MCP arch: Zen 4 gen: 4 level: v4 note: check built: 2022+
    process: TSMC n5 (5nm) family: 0x19 (25) model-id: 0x74 (116) stepping: 1
    microcode: 0xA704107
  Topology: cpus: 1x dies: 1 clusters: 1 cores: 8 threads: 16 tpc: 2
    smt: enabled cache: L1: 512 KiB desc: d-8x32 KiB; i-8x32 KiB L2: 8 MiB
    desc: 8x1024 KiB L3: 16 MiB desc: 1x16 MiB
  Speed (MHz): avg: 1098 min/max: 400/5137 boost: enabled scaling:
    driver: amd-pstate-epp governor: performance cores: 1: 1098 2: 1098 3: 1098
    4: 1098 5: 1098 6: 1098 7: 1098 8: 1098 9: 1098 10: 1098 11: 1098 12: 1098
    13: 1098 14: 1098 15: 1098 16: 1098 bogomips: 121377
  Flags: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3 svm
  Vulnerabilities: <filter>
Graphics:
  Device-1: Advanced Micro Devices [AMD/ATI] Navi 33 [Radeon RX 7600/7600
    XT/7600M XT/7600S/7700S / PRO W7600] vendor: Gigabyte driver: amdgpu
    v: kernel arch: RDNA-3 code: Navi-3x process: TSMC n6 (6nm) built: 2023+
    pcie: gen: 4 speed: 16 GT/s lanes: 8 ports: active: none empty: DP-1,
    DP-2, HDMI-A-1, HDMI-A-2, Writeback-1 bus-ID: 07:00.0 chip-ID: 1002:7480
    class-ID: 0300
  Device-2: Advanced Micro Devices [AMD/ATI] Phoenix1 driver: amdgpu
    v: kernel arch: RDNA-3 code: Phoenix process: TSMC n4 (4nm) built: 2023+
    pcie: gen: 4 speed: 16 GT/s lanes: 16 ports: active: DP-3 empty: DP-10,
    DP-4, DP-5, DP-6, DP-7, DP-8, DP-9, HDMI-A-3, Writeback-2 bus-ID: c8:00.0
    chip-ID: 1002:15bf class-ID: 0300 temp: 40.0 C
  Display: wayland server: Xwayland v: 24.1.6 compositor: Sway v: 0.5
    driver: gpu: amdgpu display-ID: 1
  Monitor-1: DP-3 model: Asus PB278 serial: <filter> built: 2016 res:
    mode: 2560x1440 hz: 60 scale: 100% (1) dpi: 109 gamma: 1.2
    size: 597x336mm (23.5x13.23") diag: 685mm (27") ratio: 16:9 modes:
    max: 2560x1440 min: 720x400
  API: Vulkan v: 1.4.309 layers: 10 device: 0 type: integrated-gpu name: AMD
    Radeon 780M (RADV PHOENIX) driver: N/A device-ID: 1002:15bf
    surfaces: xcb,xlib,wayland device: 1 type: discrete-gpu name: AMD Radeon
    RX 7600 XT (RADV NAVI33) driver: N/A device-ID: 1002:7480
    surfaces: xcb,xlib,wayland device: 2 type: cpu name: llvmpipe (LLVM
    19.1.7 256 bits) driver: N/A device-ID: 10005:0000
    surfaces: xcb,xlib,wayland
  API: EGL Message: EGL data requires eglinfo. Check --recommends.
  Info: Tools: api: vulkaninfo wl: kanshi, swaymsg, wdisplays
    x11: xprop,xrandr
Audio:
  Device-1: Advanced Micro Devices [AMD/ATI] Navi 31 HDMI/DP Audio
    driver: snd_hda_intel v: kernel pcie: gen: 4 speed: 16 GT/s lanes: 8
    bus-ID: 07:00.1 chip-ID: 1002:ab30 class-ID: 0403
  Device-2: Advanced Micro Devices [AMD/ATI] Rembrandt Radeon High
    Definition Audio driver: snd_hda_intel v: kernel pcie: gen: 4
    speed: 16 GT/s lanes: 16 bus-ID: c8:00.1 chip-ID: 1002:1640 class-ID: 0403
  Device-3: Advanced Micro Devices [AMD] ACP/ACP3X/ACP6x Audio Coprocessor
    driver: snd_pci_ps v: kernel alternate: snd_pci_acp3x, snd_rn_pci_acp3x,
    snd_pci_acp5x, snd_pci_acp6x, snd_acp_pci, snd_rpl_pci_acp6x,
    snd_sof_amd_renoir, snd_sof_amd_rembrandt, snd_sof_amd_vangogh,
    snd_sof_amd_acp63, snd_sof_amd_acp70 pcie: gen: 4 speed: 16 GT/s lanes: 16
    bus-ID: c8:00.5 chip-ID: 1022:15e2 class-ID: 0480
  Device-4: Advanced Micro Devices [AMD] Family 17h/19h/1ah HD Audio
    driver: snd_hda_intel v: kernel pcie: gen: 4 speed: 16 GT/s lanes: 16
    bus-ID: c8:00.6 chip-ID: 1022:15e3 class-ID: 0403
  API: ALSA v: k6.13.7-zen1-1-zen status: kernel-api with: aoss
    type: oss-emulator tools: alsactl,alsamixer,amixer
  Server-1: sndiod v: N/A status: off tools: aucat,midicat,sndioctl
  Server-2: PipeWire v: 1.4.1 status: active with: 1: pipewire-pulse
    status: active 2: wireplumber status: active 3: pipewire-alsa type: plugin
    4: pw-jack type: plugin tools: pactl,pw-cat,pw-cli,wpctl
Network:
  Device-1: Realtek RTL8125 2.5GbE driver: r8169 v: kernel pcie: gen: 2
    speed: 5 GT/s lanes: 1 port: f000 bus-ID: 02:00.0 chip-ID: 10ec:8125
    class-ID: 0200
  IF: enp2s0 state: up speed: 2500 Mbps duplex: full mac: <filter>
  Device-2: Realtek RTL8125 2.5GbE driver: r8169 v: kernel pcie: gen: 2
    speed: 5 GT/s lanes: 1 port: e000 bus-ID: 03:00.0 chip-ID: 10ec:8125
    class-ID: 0200
  IF: enp3s0 state: down mac: <filter>
  Device-3: Intel Wi-Fi 6E AX210/AX1675 2x2 [Typhoon Peak]
    vendor: Rivet Networks Killer driver: iwlwifi v: kernel pcie: gen: 2
    speed: 5 GT/s lanes: 1 bus-ID: 04:00.0 chip-ID: 8086:2725 class-ID: 0280
  IF: wlp4s0 state: down mac: <filter>
  Info: services: NetworkManager, smbd, sshd, systemd-timesyncd,
    wpa_supplicant
Bluetooth:
  Device-1: Intel AX210 Bluetooth driver: btusb v: 0.8 type: USB rev: 2.0
    speed: 12 Mb/s lanes: 1 mode: 1.1 bus-ID: 1-5:4 chip-ID: 8087:0032
    class-ID: e001
  Report: btmgmt ID: hci0 rfk-id: 0 state: up address: <filter> bt-v: 5.3
    lmp-v: 12 status: discoverable: yes pairing: yes class-ID: 6c0104
Drives:
  Local Storage: total: 953.87 GiB used: 59.39 GiB (6.2%)
  SMART Message: Required tool smartctl not installed. Check --recommends
  ID-1: /dev/nvme0n1 maj-min: 259:0 vendor: Kingston model: OM8PGP41024Q-A0
    size: 953.87 GiB block-size: physical: 512 B logical: 512 B speed: 63.2 Gb/s
    lanes: 4 tech: SSD serial: <filter> fw-rev: ELFK0S.6 temp: 39.9 C
    scheme: GPT
Partition:
  ID-1: / raw-size: 953.57 GiB size: 953.57 GiB (100.00%)
    used: 59.38 GiB (6.2%) fs: btrfs dev: /dev/nvme0n1p2 maj-min: 259:2
  ID-2: /boot/efi raw-size: 300 MiB size: 299.4 MiB (99.80%)
    used: 608 KiB (0.2%) fs: vfat dev: /dev/nvme0n1p1 maj-min: 259:1
  ID-3: /home raw-size: 953.57 GiB size: 953.57 GiB (100.00%)
    used: 59.38 GiB (6.2%) fs: btrfs dev: /dev/nvme0n1p2 maj-min: 259:2
  ID-4: /var/log raw-size: 953.57 GiB size: 953.57 GiB (100.00%)
    used: 59.38 GiB (6.2%) fs: btrfs dev: /dev/nvme0n1p2 maj-min: 259:2
  ID-5: /var/tmp raw-size: 953.57 GiB size: 953.57 GiB (100.00%)
    used: 59.38 GiB (6.2%) fs: btrfs dev: /dev/nvme0n1p2 maj-min: 259:2
Swap:
  Kernel: swappiness: 133 (default 60) cache-pressure: 100 (default) zswap: no
  ID-1: swap-1 type: zram size: 29.08 GiB used: 1022.5 MiB (3.4%)
    priority: 100 comp: zstd avail: lzo-rle,lzo,lz4,lz4hc,deflate,842
    max-streams: 16 dev: /dev/zram0
Sensors:
  System Temperatures: cpu: 45.2 C mobo: 39.5 C
  Fan Speeds (rpm): N/A
  GPU: device: amdgpu temp: 41.0 C watts: 17.09 device: amdgpu temp: 48.0 C
    mem: 25.0 C fan: 0 watts: 101.00
Info:
  Memory: total: 28 GiB note: est. available: 29.08 GiB used: 6.18 GiB (21.2%)
  Processes: 466 Power: uptime: 1d 7h 13m states: freeze,mem,disk
    suspend: s2idle wakeups: 0 hibernate: platform avail: shutdown, reboot,
    suspend, test_resume image: 11.62 GiB services: upowerd Init: systemd
    v: 257 default: graphical tool: systemctl
  Packages: pm: pacman pkgs: 1424 libs: 460 tools: pacseek,paru Compilers:
    gcc: 14.2.1 Shell: garuda-inxi default: fish v: 4.0.1 running-in: foot
    inxi: 3.3.37
Garuda (2.7.2-1):
  System install date:     2025-03-01
  Last full system update: 2025-03-23 ↻
  Is partially upgraded:   No
  Relevant software:       snapper NetworkManager dracut
  Windows dual boot:       Probably (Run as root to verify)
  Failed units:            

That is normal. This is a file for you to populate on your own, with whatever defaults you want to use.

You haven’t really described what specifically is happening, but if you are trying to change the default web browser and something is still opening the old browser, then it is probably bound to a MIME type in /usr/share/applications/mimeinfo.cache that hasn’t been explicitly defined in one of the mimeapps.list configs.

It looks like you put the same line twice.

Typically a browser will have more associations than just one or two. For example:

❯ cat .config/mimeapps.list | grep librewolf
text/html=librewolf.desktop
application/xhtml+xml=librewolf.desktop
application/xml=librewolf.desktop
x-scheme-handler/http=librewolf.desktop
application/x-xpinstall=librewolf.desktop
application/json=librewolf.desktop
x-scheme-handler/https=librewolf.desktop
application/pdf=librewolf.desktop

I think the larger DEs like Gnome or KDE have built-in utilities for handling this without having to tinker with config files, but with Sway it is left to the user to manage on their own.

Personally, I am fond of this simple AUR package, which is very handy for this:

Install like this:

paru -S selectdefaultapplication-fork-git

It opens up a nice three-panel GUI window with your applications on the left, file types that application can open in the center, and file types that application is currently set to open by default on the right.

Choose an application, highlight the file types you want it to open, and click “Set as default application for these file types” and it will automatically populate ~/.config/mimeapps.list according to your selection.

If you already have an application in ~/.config/mimeapps.list assigned to that file type, it will give you a heads-up and allow you to decide if you want to overwrite the existing settings or not.

I hope that helps, welcome to the community @boomboxnation. :wave:

5 Likes

Thanks a million for pointing me towards theappwiththereallylongname (selectdefaultapplication-fork-git). I’ve never liked basically copy-pasting somebody else’s likely copy-sed’d-pasted (ad infintum=bit rot) mimeapps.

Decided to associate my text/source files with something sane for the times I trigger one opening via xdg/clicking something.

I did copy and paste the same line twice with the intent to edit. (I edited the original, just didn’t want your call out to seem off)

Like I said originally…it would be nice to have selectdefaultapplication-fork-git possibly garuda-ized and added to Rani. But I was only testing with links in one strange little app…maybe all my tweaking of BROWSER and xdg-settings (after `set -e BROWSER’ and then setting it back after) was working.

Thanks again all for this and my new favorite sway install. (having a sway-spin at all anymore is the only thing that brought me to garuda…and I discovered so many more reasons to stay.

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.