Why doesn't Default Applications have file manager?

I installed VS Code, and for some reason, it because the default file manager for opening directories. Gnome Setting’s Default Applications have entries for Web, Mail, Calendar, Music, etc, but not default file manager. Opening a directory with “Open with…” allowed me to open a directory with Files, but unlike the cases of other file types, it had no “Always use for this file type” checkbox, so I could not set the default.

After searching the web and some trial-and-error, I figured out that I need to run

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

in the terminal, but this is NOT user-friendly. I wonder why Settings don’t have a drop-down for the default file browser? If this is because there is no way to get the list of installed file managers, at least a “Restore default file manager (Gnome Files)” button would be helpful there.

That’s because your distribution is not shipping a list of default applications for common MIME types.

Ideally, GNOME would ship that file, but then every distribution would end up changing something because what GNOME considers a “default application” may very well be not what a downstream distributor considers a default—for instance, because they ship something different, or because they don’t ship that application at all.

Some downstream distributors—like Fedora and Ubuntu—do provide defaults that match what they ship, but there are distributors that don’t want to make that decision, so whenever you install an application that handles a MIME type, and whose name comes before Nautilus in the lexicographical order, you’ll get that application as the default.

Because there are thousands of possible MIME types, and each one of them can have a default application.

This is a longstanding defect that we ought to fix. We should ship some base defaults somewhere and distros can override as desired. I think @hadess wanted to put them in the gnome-desktop package. I’m not sure if that’s really the best place, but I can’t exactly think of anything better either.

1 Like

AFAIR, we were waiting to have a proper consolidated list of core applications before committing to that. These days we have a more formal structure, so I think we can add it, it’s just that nobody found the time to do it.

Adding it to gnome-desktop is fine by me.

1 Like

I suppose the primary remaining problem is that we have no core application that’s capable of opening audio files, since totem dropped support for that. :frowning:

Um, also email. It just feels weird to offer these choices but not have any apps that can actually fit them.

I mean, if we want to go into the weeds: that whole page of the settings should just go away at this point.

The MIME types it represents are undocumented (I had to add a flavour of OGG to include Amberol in the music players list, and only after looking at the code), and the scopes are entirely arbitrary. Some of them are MIME types, some are URI scheme handlers, and some cannot be added because they don’t match either.

The default MIME type and URI scheme type handlers for GNOME should replace them; then we’d need some additional UI into the Applications settings to mark an application as the default without necessarily going through Nautilus.

I don’t understand this explanation. If default file manager cannot be displayed because my distribution does not have the list, how come Settings can have default applications for other types of applications? Here is the screenshot of the Settings of my distribution:

Settings allows changing defaults for particular MIME types.

If you don’t have any defaults at all, I think GNOME will launch whichever comes first alphabetically. VS Code probably sorts alphabetically higher than nautilus (“com.visualstudio.code” vs. “org.gnome.Nautilus”). So there you have it. All major distributions ship defaults to prefer nautilus or their default file manager, except Arch. Maybe some other smaller distros don’t either.

Arch Linux has gnome-defaults-list as option for this.

After reading your comment, I installed it and rebooted the PC, but there was no difference. I do not see file manager.

I had the same issue, it can be fixed on the command line by using xdg-mime:

$ xdg-mime query default inode/directory
com.visualstudio.code
$ xdg-mime default org.gnome.Nautilus.desktop inode/directory
$ xdg-mime query default inode/directory
org.gnome.Nautilus.desktop

I also think shipping defaults is a good idea, to avoid unexpected applications being used to open things after they are installed.

1 Like

You’ll never see a file manager option there because Settings does not expose it. Only a few select file types are exposed there.

But if you install the package suggested by jakedane then you should have more reasonable defaults for everything that you cannot see. E.g. nautilus will probably be preferred over VS Code now.

And yes, Jummit’s suggestion is the correct way to change your default file manager.

I kind of feel like repeating myself, but why not have GUI default application settings for file manager using inode/directory? That is the type I used for the command-line command. Not only a weird case like VS Code, people may want to install multiple versions of file managers (such as Dolphin, Thunar, etc) and want to test each of them for a while, and currently they would have to change the default file manager via command-line.

1 Like

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