How to fix wrong file type association in Gn

Under my linux Gnome box, folders on the desktop suddenly started to opened with VSCode. This is guide to fix file asscoiation problems on Arch based machines.

2023-03-19

This is not the first time, the same thing happened with Gnomes Archive Manager a year ago. Sometimes programs updated though pacman are updating file associations as well it seems. This time Visual Studo Code caused some unpleasant moments.

Thankfullly this was not a unique problem. Some folks had the same issue at the Arch Forums.

Based on this I could check the current file associatios with xdg-mime query default inode/directory.

Or we can use cat /usr/share/applications/mimeinfo.cache .

Showing the line in gnome for aesthetics. :)
As you can see VSCode put itself in front of Gnomes default file manager.

So we can fix this in two ways:

  • First is to monkey patch and directly edit the /usr/share/applications/mimeinfo.cache but this will be overwritten next time for sure.
  • Or we can use sudo xdg-mime default nautilus.desktop inode/directory and hope this won't be overwritten next time.

Again thanks for the guys at the Arch Forums.

This site is using Google Analitics Privacy Policy and Terms of Service.