nautilus does not open a new window when opening a folder in a browser

anim

Is there a way to make it open a new window instead of a focused window?

Hi there, I am not aware of any way around this, it’s nautilus way of preventing too many open windows. What is the issue with focusing an open window?

FWIW, nautilus has the following option to open URI in new window.

-w, --new-window  Always open a new window for browsing specified URIs

But web browsers don’t directly call nautilus, but the default file manager (which can also be thunar / nemo etc) set in the system. But, it shouldn’t be difficult to achieve what you’re trying to do.

2 Likes

Thanks Sid, I didn’t know how to get the browser to pass this option to nautilus.

❯ xdg-mime query default inode/directory
org.gnome.Nautilus.desktop
❯ cat /usr/share/applications/org.gnome.Nautilus.desktop | grep Exec
Exec=nautilus --new-window %U
Exec=nautilus --new-window

Launching nautilus from command line and launching nautilus via D-Bus (from web browser) are 2 different things.

  1. The former is a simple direct command launch. Refer nautilus-application.c for more details.
  2. The later involves mime type processing and selecting 1 app from apps supporting the freedesktop.org File Manager DBus Interface. Refer nautilus-freedesktop-dbus.c for more details.

It appears that nautilus does not open a new window for the same URI when launched via [2], though this always works with [1]. This might be a conscious decision to not launch too many windows which might clutter the desktop. In most cases, it makes perfect sense.

If you’d like to always open a new window, I’d look into discussions in this recent thread. I would create a wrapper shell script around nautilus if necessary.

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