[GNOME] Apps do not open Nautilus when prompted to

If I want an app to open a folder, such as browsing the files of my game in Steam or opening my resource pack folder in Minecraft, it opens Amberol instead of Nautilus. Deleting Amberol also did not fix the problem and instead resulted in it not doing anything at all

I’ve tried this with Steam, Minecraft through Prism, and Minecraft through Prism installed as Flatpak. in all cases it does not open Gnome files. Any help? I don’t know how to fix this, and my only Nautilus related setting is switching it to list-view. I’d post my whole config but Codeberg is having an outage as of posting this :[

Feels like there’s an issue with xdg-desktop-portal. Sorry I can’t help you. If you think you haven’t done any relevant configuration, please open an issue in Nixpkgs so that maintainers can follow up.

There may be an issue with your xdg-mime mappings. Can you try running the following?

xdg-mime query default inode/directory

I’ve found KDE’s handling of mime types is a little buggy and depends a lot on the environment (not GNOME’s, but just as an aside to note that the behavior of mime associations may differ between applications), and sometimes the xdg-open functionality will behave differently depending on the environment that the application is running from (for me, whether I launch it from a terminal or from my bindsyms has an impact.)

You could try setting explicit associations:

{
  xdg.mime = {
    addedAssociations = {
      # This shouldn't be necessary, but just for good measure...
      "inode/directory" = "org.gnome.Nautilus.desktop";
    };
    defaultApplications = {
      "inode/directory" = "org.gnome.Nautilus.desktop";
    };
  };
}

Or, you could try setting it as the default for your user:

$ xdg-mime default org.gnome.Nautilus.desktop inode/directory

(This can also be applied with home manager.)

If you have more trouble, you can try changing whether xdg-open uses desktop portals using the xdg.portal.xdgOpenUsePortal option. Sometimes it is desirable to use this option because it will result in the application that is being opened starting in the xdg-desktop-portal service environment rather than whatever arbitrary environment a given program is in.

Unfortunately I don’t necessarily have the correct answer but I hope this gets you in the right direction.

1 Like

This worked for me! And xdg-mime qwuery default inode/directory did return Amberol, so setting it with the xdg.mime setting you suggested has fixed the issue, thanks!

1 Like