Change default internet browser

System:
  Kernel: 6.6.8-arch1-1-g14 arch: x86_64 bits: 64 compiler: gcc v: 13.2.1
    clocksource: tsc available: acpi_pm parameters: ibt=off pm_debug_messages
    amd_pmc.dyndbg="+p" acpi.dyndbg="file drivers/acpi/x86/s2idle.c +p"
    BOOT_IMAGE=/@/boot/vmlinuz-linux-g14
    root=UUID=c7fe130c-22b1-4ec2-b957-ea9df6bb079a rw rootflags=subvol=@
    quiet loglevel=3 amd.dcdebugmask=0x10 nvidia_drm.modset=1
    systemd.unified_cgroup_hierarchy=1 splash ibt=off
  Desktop: Hyprland info: waybar vt: 1 dm: SDDM Distro: Garuda Linux
    base: Arch Linux
Machine:
  Type: Laptop System: ASUSTeK product: ROG Zephyrus G14 GA402XY_GA402XY
    v: 1.0 serial: <superuser required>
  Mobo: ASUSTeK model: GA402XY v: 1.0 serial: <superuser required>
    UEFI: American Megatrends LLC. v: GA402XY.313 date: 08/10/2023
Battery:
  ID-1: BAT0 charge: 59.8 Wh (80.1%) condition: 74.7/76.0 Wh (98.3%)
    volts: 16.8 min: 15.9 model: AS3FYCe3KC GA40249 type: Unknown
    serial: <filter> status: not charging
CPU:
  Info: model: AMD Ryzen 9 7940HS w/ Radeon 780M Graphics bits: 64
    type: MT MCP arch: Zen 4 gen: 5 level: v4 note: check built: 2022+
    process: TSMC n5 (5nm) family: 0x19 (25) model-id: 0x74 (116) stepping: 1
    microcode: 0xA704103
  Topology: cpus: 1x cores: 8 tpc: 2 threads: 16 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: 818 high: 1414
    min/max: 400/5263:6228:5583:5423:6067:5903:5743 scaling:
    driver: amd-pstate-epp governor: powersave cores: 1: 1383 2: 400 3: 1330
    4: 400 5: 400 6: 1240 7: 400 8: 1414 9: 1409 10: 400 11: 1314 12: 400
    13: 400 14: 400 15: 400 16: 1405 bogomips: 127807
  Flags: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3 svm
  Vulnerabilities: <filter>
Graphics:
  Device-1: NVIDIA GN21-X11 vendor: ASUSTeK driver: nvidia v: 545.29.06
    alternate: nvidia_drm non-free: 545.xx+ status: current (as of 2023-10)
    arch: Lovelace code: AD1xx process: TSMC n4 (5nm) built: 2022+ pcie:
    gen: 1 speed: 2.5 GT/s lanes: 8 link-max: gen: 4 speed: 16 GT/s lanes: 16
    ports: active: none empty: DP-9,HDMI-A-1,eDP-2 bus-ID: 01:00.0
    chip-ID: 10de:2757 class-ID: 0300
  Device-2: AMD Phoenix1 vendor: ASUSTeK 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-12 off: eDP-1 empty: DP-1,
    DP-10, DP-11, DP-13, DP-14, DP-2, DP-3, DP-4, DP-5, DP-6, DP-7, DP-8
    bus-ID: 65:00.0 chip-ID: 1002:15bf class-ID: 0300 temp: 42.0 C
  Device-3: Sonix USB2.0 FHD UVC WebCam driver: uvcvideo type: USB rev: 2.0
    speed: 480 Mb/s lanes: 1 mode: 2.0 bus-ID: 3-1:2 chip-ID: 3277:0018
    class-ID: 0e02
  Device-4: Logitech Webcam C930e driver: snd-usb-audio,uvcvideo type: USB
    rev: 2.0 speed: 480 Mb/s lanes: 1 mode: 2.0 bus-ID: 5-1.4.4.2:8
    chip-ID: 046d:0843 class-ID: 0102
  Display: wayland server: X.org v: 1.21.1.10 with: Xwayland v: 23.2.3
    compositor: Hyprland driver: X: loaded: amdgpu,nvidia
    unloaded: modesetting,nouveau alternate: fbdev,nv,vesa dri: radeonsi
    gpu: amdgpu display-ID: 1
  Monitor-1: DP-12 model: Mi Monitor built: 2020 res: 3440x1440 hz: 144
    dpi: 110 gamma: 1.2 scale: 1 size: 797x334mm (31.38x13.15")
    diag: 864mm (34") modes: max: 3440x1440 min: 720x400
  Monitor-2: eDP-1 model: AU Optronics B140QAN06.S built: 2022
    res: 3440x1440 dpi: 216 gamma: 1.2 size: 301x188mm (11.85x7.4")
    diag: 355mm (14") ratio: 16:10 modes: max: 2560x1600 min: 640x480
  API: EGL v: 1.5 hw: drv: nvidia drv: amd radeonsi platforms: device: 0
    drv: nvidia device: 2 drv: radeonsi device: 3 drv: swrast gbm: drv: nvidia
    surfaceless: drv: nvidia wayland: drv: radeonsi x11: drv: radeonsi
    inactive: device-1
  API: OpenGL v: 4.6.0 compat-v: 4.5 vendor: nvidia mesa v: 545.29.06
    glx-v: 1.4 direct-render: yes renderer: NVIDIA GeForce RTX 4090 Laptop
    GPU/PCIe/SSE2 memory: 15.62 GiB
  API: Vulkan v: 1.3.274 layers: 8 device: 0 type: integrated-gpu name: AMD
    Radeon Graphics (RADV GFX1103_R1) driver: mesa radv v: 23.3.2-arch1.2
    device-ID: 1002:15bf surfaces: xcb,xlib,wayland device: 1
    type: discrete-gpu name: NVIDIA GeForce RTX 4090 Laptop GPU driver: nvidia
    v: 545.29.06 device-ID: 10de:2757 surfaces: xcb,xlib,wayland device: 2
    type: cpu name: llvmpipe (LLVM 16.0.6 256 bits) driver: mesa llvmpipe
    v: 23.3.2-arch1.2 (LLVM 16.0.6) device-ID: 10005:0000
    surfaces: xcb,xlib,wayland
Audio:
  Device-1: NVIDIA vendor: ASUSTeK driver: snd_hda_intel v: kernel pcie:
    gen: 4 speed: 16 GT/s lanes: 8 link-max: lanes: 16 bus-ID: 01:00.1
    chip-ID: 10de:22bb class-ID: 0403
  Device-2: AMD Rembrandt Radeon High Definition Audio vendor: ASUSTeK
    driver: snd_hda_intel v: kernel pcie: gen: 4 speed: 16 GT/s lanes: 16
    bus-ID: 65:00.1 chip-ID: 1002:1640 class-ID: 0403
  Device-3: AMD ACP/ACP3X/ACP6x Audio Coprocessor vendor: ASUSTeK
    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 pcie:
    gen: 4 speed: 16 GT/s lanes: 16 bus-ID: 65:00.5 chip-ID: 1022:15e2
    class-ID: 0480
  Device-4: AMD Family 17h/19h HD Audio vendor: ASUSTeK
    driver: snd_hda_intel v: kernel pcie: gen: 4 speed: 16 GT/s lanes: 16
    bus-ID: 65:00.6 chip-ID: 1022:15e3 class-ID: 0403
  Device-5: SAVITECH JDS Labs Element DAC
    driver: hid-generic,snd-usb-audio,usbhid type: USB rev: 1.1 speed: 12 Mb/s
    lanes: 1 mode: 1.1 bus-ID: 5-1.4.4.1.1.3:12 chip-ID: 262a:1048
    class-ID: 0102
  Device-6: TC GoXLR driver: snd-usb-audio type: USB rev: 2.0
    speed: 480 Mb/s lanes: 1 mode: 2.0 bus-ID: 5-1.4.4.1.4:10 chip-ID: 1220:8fe0
    class-ID: 0102
  Device-7: Logitech Webcam C930e driver: snd-usb-audio,uvcvideo type: USB
    rev: 2.0 speed: 480 Mb/s lanes: 1 mode: 2.0 bus-ID: 5-1.4.4.2:8
    chip-ID: 046d:0843 class-ID: 0102
  Device-8: Lenovo ThinkPad Thunderbolt 4 Dock USB Audio
    driver: hid-generic,snd-usb-audio,usbhid type: USB rev: 2.0 speed: 12 Mb/s
    lanes: 1 mode: 1.1 bus-ID: 5-1.4.4.4:14 chip-ID: 17ef:30bb class-ID: 0300
    serial: <filter>
  API: ALSA v: k6.6.8-arch1-1-g14 status: kernel-api tools: N/A
  Server-1: sndiod v: N/A status: off tools: aucat,midicat,sndioctl
  Server-2: PipeWire v: 1.0.0 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: MEDIATEK MT7922 802.11ax PCI Express Wireless Network Adapter
    vendor: Foxconn driver: mt7921e v: kernel pcie: gen: 2 speed: 5 GT/s
    lanes: 1 bus-ID: 02:00.0 chip-ID: 14c3:0616 class-ID: 0280
  IF: wlp2s0 state: down mac: <filter>
  Device-2: Realtek RTL8153 Gigabit Ethernet Adapter driver: r8152 type: USB
    rev: 3.0 speed: 5 Gb/s lanes: 1 mode: 3.2 gen-1x1 bus-ID: 6-1.4.4.3:5
    chip-ID: 0bda:8153 class-ID: 0000 serial: <filter>
  IF: eth0 state: up speed: 1000 Mbps duplex: full mac: <filter>
Bluetooth:
  Device-1: Foxconn / Hon Hai Wireless_Device driver: btusb v: 0.8 type: USB
    rev: 2.1 speed: 480 Mb/s lanes: 1 mode: 2.0 bus-ID: 1-5:3 chip-ID: 0489:e0f6
    class-ID: e001 serial: <filter>
  Report: btmgmt ID: hci0 rfk-id: 0 state: up address: <filter> bt-v: 5.2
    lmp-v: 11 status: discoverable: no pairing: no class-ID: 6c010c
Drives:
  Local Storage: total: 1.86 TiB used: 627.29 GiB (32.9%)
  SMART Message: Unable to run smartctl. Root privileges required.
  ID-1: /dev/nvme0n1 maj-min: 259:0 vendor: solidgm model: SSDPFKKW020X7
    size: 1.86 TiB block-size: physical: 512 B logical: 512 B speed: 63.2 Gb/s
    lanes: 4 tech: SSD serial: <filter> fw-rev: 001C temp: 36.9 C scheme: GPT
Partition:
  ID-1: / raw-size: 136.72 GiB size: 136.72 GiB (100.00%)
    used: 37.97 GiB (27.8%) fs: btrfs dev: /dev/nvme0n1p2 maj-min: 259:2
  ID-2: /boot/efi raw-size: 500 MiB size: 499 MiB (99.80%)
    used: 32.6 MiB (6.5%) fs: vfat dev: /dev/nvme0n1p1 maj-min: 259:1
  ID-3: /home raw-size: 20.51 GiB size: 20.51 GiB (100.00%)
    used: 19.2 GiB (93.6%) fs: btrfs dev: /dev/nvme0n1p3 maj-min: 259:3
  ID-4: /var/log raw-size: 136.72 GiB size: 136.72 GiB (100.00%)
    used: 37.97 GiB (27.8%) fs: btrfs dev: /dev/nvme0n1p2 maj-min: 259:2
  ID-5: /var/tmp raw-size: 136.72 GiB size: 136.72 GiB (100.00%)
    used: 37.97 GiB (27.8%) 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: 30.57 GiB used: 0 KiB (0.0%) priority: 100
    comp: zstd avail: lzo,lzo-rle,lz4,lz4hc,842 max-streams: 16 dev: /dev/zram0
Sensors:
  System Temperatures: cpu: 42.0 C mobo: N/A gpu: amdgpu temp: 43.0 C
  Fan Speeds (rpm): cpu: 0
Info:
  Processes: 423 Uptime: 5m wakeups: 0 Memory: total: 32 GiB note: est.
  available: 30.58 GiB used: 3.46 GiB (11.3%) Init: systemd v: 255
  default: graphical tool: systemctl Compilers: gcc: 13.2.1 alt: 12
  clang: 16.0.6 Packages: pm: pacman pkgs: 2071 libs: 524 tools: octopi,paru
  Shell: fish v: 3.7.0 running-in: foot inxi: 3.3.31
Garuda (2.6.22-1):
  System install date:     2023-12-07
  Last full system update: 2024-01-09 ↻
  Is partially upgraded:   No
  Relevant software:       snapper NetworkManager dracut
  Windows dual boot:       Probably (Run as root to verify)
  Failed units:            

How do I change default applications in Garuda-Hyprland, the internet browser, to be more specific? Cause when I use xdg-settings to change my default browser:

 ╰─λ xdg-settings set default-web-browser librewolf.desktop

I get:

xdg-settings: $BROWSER is set and can't be changed with xdg-settings

Hi @caniko , did you try setting the librewolf browser as default from the browser settings ?

2 Likes

see:

~/.config/hypr/hyprstart
6 Likes

Thanks Ankur, I also added:

[Default Applications]
text/html=librewolf.desktop
x-scheme-handler/http=librewolf.desktop
x-scheme-handler/https=librewolf.desktop
x-scheme-handler/about=librewolf.desktop
x-scheme-handler/unknown=librewolf.desktop

To ~/.config/mimeapps.list

1 Like

For future reference for other Hyprland users who’re searching and struggling with this issue, here’s an example mimeapps.list. The Hyprland one comes quite barren, and since $BROWSER is set in ~/.config/hypr/hyprstart, you can’t use xdg-settings to change it. Unfortunately, sometimes just setting $BROWSER doesn’t work, so mimeapps.list is needed.
(This one is from my current Qtile setup)

[Default Applications]
text/html=librewolf.desktop
x-scheme-handler/http=librewolf.desktop
x-scheme-handler/https=librewolf.desktop
x-scheme-handler/about=librewolf.desktop
x-scheme-handler/unknown=librewolf.desktop
image/jpeg=org.kde.gwenview.desktop
image/png=org.kde.gwenview.desktop
application/x-shellscript=micro.desktop
text/plain=micro.desktop
application/vnd.ms-publisher=userapp-micro-0XUDH2.desktop
application/pdf=chromium.desktop
application/json=micro.desktop

[Added Associations]
image/jpeg=org.kde.gwenview.desktop;
image/png=org.kde.gwenview.desktop;
application/x-shellscript=micro.desktop;
text/plain=xarchiver.desktop;micro.desktop;
image/x-dib=org.kde.gwenview.desktop;
application/vnd.ms-publisher=userapp-micro-0XUDH2.desktop;
application/pdf=chromium.desktop;
application/json=micro.desktop;

[Removed Associations]

For the browser, replace librewolf.desktop with your preferred browser, and make sure to keep the .desktop extension. You can also take the other entries for other applications, like image viewers (KDE Gwenview).

2 Likes

The termbin link would eventually expire. It would be best to post the config in code block but I will leave that decision to you.

2 Likes

Oh cool, I didn’t realise termbin links expire lol. It was simply a relic from posting on the social chat :slight_smile: updated the post!

1 Like

A while ago I found this GUI app that’s in the AUR which basically sets up your mimeapps.list for you: https://github.com/magnus-ISU/selectdefaultapplication

It’s stupid easy to use. The menu shows all your apps that have a .desktop file, you just click on one and it will show all the different types of files it can open. Highlight any file types you want that app to open by default, and it will set up your ~/.config/mimeapps.list for you.

For example, let’s say I want to set mpv as the default for any file type it supports. Click the app, optionally de-select anything you don’t want it to be the default for (it defaults to selecting all), then click “set as default application”:

Now the app shows that mpv is the app which currently opens these file types:

When I open ~/.config/mimeapps.list I can see all these file associations have been added (underneath the Thunar entry which was already in there):

[Default Applications]
inode/directory=thunar.desktop
video/x-theora+ogg=mpv.desktop
video/mp4=mpv.desktop
audio/x-vorbis+ogg=mpv.desktop
video/x-flv=mpv.desktop
application/ogg=mpv.desktop
application/mxf=mpv.desktop
application/x-shorten=mpv.desktop
application/vnd.rn-realmedia=mpv.desktop
video/mp2t=mpv.desktop
audio/x-scpls=mpv.desktop
application/x-matroska=mpv.desktop
video/webm=mpv.desktop
audio/AMR=mpv.desktop
audio/x-wavpack=mpv.desktop
video/vnd.mpegurl=mpv.desktop
audio/vnd.dts=mpv.desktop
video/x-matroska=mpv.desktop
video/x-ms-wmv=mpv.desktop
video/x-ogm+ogg=mpv.desktop
video/vnd.rn-realvideo=mpv.desktop
audio/mpeg=mpv.desktop
application/vnd.apple.mpegurl=mpv.desktop
audio/x-ms-wma=mpv.desktop
video/vnd.avi=mpv.desktop
application/smil+xml=mpv.desktop
audio/aac=mpv.desktop
video/x-flic=mpv.desktop
video/mpeg=mpv.desktop
audio/vnd.dts.hd=mpv.desktop
audio/ac3=mpv.desktop
application/vnd.ms-asf=mpv.desktop
application/x-cue=mpv.desktop
audio/x-ms-asx=mpv.desktop
audio/x-aiff=mpv.desktop
video/quicktime=mpv.desktop
audio/ogg=mpv.desktop
audio/x-matroska=mpv.desktop
audio/webm=mpv.desktop
application/sdp=mpv.desktop
audio/x-tta=mpv.desktop
audio/x-musepack=mpv.desktop
video/ogg=mpv.desktop
audio/x-adpcm=mpv.desktop
audio/vnd.rn-realaudio=mpv.desktop
audio/mp4=mpv.desktop
audio/mp2=mpv.desktop
video/3gpp2=mpv.desktop
audio/vnd.wave=mpv.desktop
audio/x-mpegurl=mpv.desktop
audio/flac=mpv.desktop
video/dv=mpv.desktop
video/3gpp=mpv.desktop
audio/x-ape=mpv.desktop

Very fast and easy!

7 Likes

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