Double-clicking desktop icons won't start Nautilus but VScode

Recently my desktop icons pointing to folders or drives won’t open in the Nautilus File manager anymore, but instead open in VScode. I most probably misconfigured something, can somebody please point me in the direction of where to start fixing this?

Relevant inxi details:

  Kernel: 6.0.11-1-MANJARO arch: x86_64 bits: 64 compiler: gcc v: 12.2.0
    parameters: BOOT_IMAGE=/@/boot/vmlinuz-6.0-x86_64
    root=UUID=b7a8a09e-5bed-46bc-99f3-5284934ef9fb ro rootflags=subvol=@ ro
    resume=UUID=3a0789c1-3b4e-404e-b30e-4b1a034eb1d6 loglevel=3
    udev.log_level=3 bootsplash.bootfile=bootsplash-themes/manjaro/bootsplash
  Desktop: GNOME v: 43.1 tk: GTK v: 3.24.35 wm: gnome-shell dm: GDM v: 43.0
    Distro: Manjaro Linux base: Arch Linux
  Type: Mini-pc System: AZW product: GTR v: N/A serial: <superuser required>
    Chassis: type: 35 serial: <superuser required>
  Mobo: AZW model: GTR v: V01 serial: <superuser required> UEFI: American
    Megatrends LLC. v: GTR_V1.24_bLink_P4C5M43 date: 06/08/2022
  Device-1: AMD Cezanne [Radeon Vega Series / Radeon Mobile Series]
    driver: amdgpu v: kernel arch: GCN-5.1 code: Vega-2 process: TSMC n7 (7nm)
    built: 2018-21 pcie: gen: 3 speed: 8 GT/s lanes: 16 link-max: gen: 4
    speed: 16 GT/s ports: active: HDMI-A-1 empty: DP-1,DP-2,DP-3
    bus-ID: 05:00.0 chip-ID: 1002:1638 class-ID: 0300 temp: 34.0 C
  Device-2: Logitech C920 PRO HD Webcam type: USB
    driver: snd-usb-audio,uvcvideo bus-ID: 1-2.4.3:8 chip-ID: 046d:08e5
    class-ID: 0102
  Display: x11 server: v: with: Xwayland v: 22.1.5
    compositor: gnome-shell driver: X: loaded: amdgpu
    unloaded: modesetting,radeon alternate: fbdev,vesa dri: radeonsi
    gpu: amdgpu display-ID: :1 screens: 1
  Screen-1: 0 s-res: 3440x1440 s-size: <missing: xdpyinfo>
  Monitor-1: HDMI-A-1 mapped: HDMI-A-0 model: Philips PHL 346B1C
    serial: <filter> built: 2022 res: 3440x1440 hz: 60 dpi: 110 gamma: 1.2
    size: 797x334mm (31.38x13.15") diag: 864mm (34") modes: max: 3440x1440
    min: 720x400
  API: OpenGL v: 4.6 Mesa 22.2.4 renderer: AMD Radeon Graphics (renoir LLVM
    14.0.6 DRM 3.48 6.0.11-1-MANJARO) direct render: Yes
  Processes: 414 Uptime: 47m wakeups: 1 Init: systemd v: 251 default: graphical
  tool: systemctl Compilers: gcc: 12.2.0 clang: 14.0.6 Packages: pm: pacman
  pkgs: 1786 libs: 459 tools: gnome-software,pamac,yay pm: flatpak pkgs: 0
  Shell: Zsh v: 5.9 running-in: gnome-terminal inxi: 3.3.24
xdg-mime default nautilus.desktop inode/directory

I had this problem too.
The fix above should work.
I believe that I did something else. If that don’t work, I can search the other way.


See man xdg-mime:

       Ask the desktop environment to make application the default application for opening files of type mimetype. An application can be made the default for several file types by specifying multiple mimetypes.

       application is the desktop file id of the application and has the form vendor-name.desktop.  application must already be installed in the desktop menu before it can be made the default handler. The application's desktop file must list
       support for all the MIME types that it wishes to be the default handler for.

       Requests to make an application a default handler may be subject to system policy or approval by the end-user. xdg-mime query can be used to verify whether an application is the actual default handler for a specific file type.

       The default option is for use inside a desktop session only. It is not recommended to use xdg-mime default as root.
  • Take special note of the last line:

    It is not recommended to use xdg-mime default as root.


Sorry for some delay and thx for all the replies. I tried this but no avail, found that even after trying to set the default, folders would still try to open in VScode.

❯ xdg-mime query default inode/directory
❯ xdg-mime default nautilus.desktop inode/directory
❯ xdg-mime query default inode/directory

Needless to say, restarting my session by logging out and in doesn’t change it. Any ideas?

This is weird to say the least, seems VSCode is enforcing it on a global level, try asking their channels?

_I don’t know how to investigate where the used mime definition is gotten from, otherwise you could know which file is interfering with your own settings…
Maybe investigate your startup files, like .profile and .bashrc or similar… nahh then it should only change after a relogin…

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