5

After going through several already-answered questions on AskUbuntu and Unix's stackexchange, Firefox's "Open containing folder" option (when a file is downloaded) still opens folder in Thunar File Manager, even though my default file manager is Nautilus. (However, it's Nautilus that's opened when prompted to save a file, for example, meaning, I guess, that Firefox is somehow aware that Nautilus exists.) I'm on XFCE (Ubuntu 22) so I can't uninstall Thunar without causing core problems (already tried that).

Nautilus (under the name Files) is set a default File Manager. In the GUI of my "Applications by default" app, inode/directory and inode/mount-point are set to Files.

I've tried to modify every mimeapps.list and defaults.list and mimeinfo.cache files possible, every single one of them has the following line:

inode/directory=org.gnome.Nautilus.desktop

(Some of them have also [Default Applications] on the line before)

Except one mimeinfo.cache that has "Catfish" and "Thunar" after Nautilus. But removing mention of Thunar with sudo doesn't change anything.

I also updated /usr/share/dbus-1/services/org.freedesktop.FileManager1.service according to suggestions, that didn't change anything.

I've closed/reopened my user session, also restarted my computer, nothing changed.

What have I missed?

Please don't mark as duplicate, since none of the answers provided in below questions solutioned my problem:

Pablo Bianchi
  • 15,657
Chloé
  • 65
  • Did you check firefox settings? Check Setting>General>applications within firefox. – mook765 Aug 25 '22 at 16:04
  • 1
    @vanadium xdg-open ~ does launch Nautilus! – Chloé Aug 26 '22 at 12:32
  • @mook765 I did... I don't think any "content type" calls Thunar: all "content types" has either "Save file", "Open in Firefox" or "Always ask" related actions, except for "magnet" and "appstream" content types that have "Use system handler (default)" related action. But I don't think it has anything to do with "Open containing folder" option, has it? When Firefox ask where I wan't to save a file, it launches correctly Nautilus. It's only when it opens containing folder of a downloaded file that it launches Thunar. – Chloé Aug 26 '22 at 12:33
  • Any update? -- Usually I was able to fix similar problem (I'm on Plasma) by modifying the mimeinfo.cache file, but with Thunar something different must be involved. A Thunar-specific question might be needed. – cipricus Sep 21 '22 at 09:05
  • @mook765 - That has nothing to do with this because that Firefox setting is about file types. This affects the location of all downloaded files. I suspect a more Thunar-specific problem here. – cipricus Sep 21 '22 at 10:24
  • I have seen a similar problem in the last 10 years very very often and I have been able to solve it by changing something like defaults.list or mimeinfo.cache: with this exception in my linked post involving exclusively Thunar, which was fixed by the dbus service method. I am very confident that your case is similar, even if services might be a bit different per desktop. By the way: IS this problem limited to Firefox? (e.g. opening a file location in Audacious playlist opens what file manager?) And what are the contents of your org.gnome.Nautilus.service file? – cipricus Sep 22 '22 at 21:58
  • Are you sure it's opening Thunar or is it just not opening nautilus. This sounds like an XY problem where you're assuming the problem is that it's opening Thunar when it's actually opening a generic file explorer. – mchid Oct 22 '22 at 12:51
  • @mchid I don't quite understand you. The fact is that it is Thunar that's opening and not Nautilus, whether it is because it's "willingly" opening Thunar or because it's not opening Nautilus and is opening instead a "generic file explorer" that happens to be Thunar. The problem stays the same: I want Nautilus to be opened, not Thunar. Would you have a solution in case it's what you're hypothesising? – Chloé Oct 23 '22 at 16:02
  • @Chloé I'm pretty sure it uses GtkFileChooser. The default search function is similar to Thunar in that it's not recursive search. In additon to GtkFileChooser is xdg-desktop-portal and xdg-desktop-portal-gtk which provides a portal for sandboxed apps like Snap apps such as firefox to interact with the filesystem. If you want to search recursively like Nautilus, click on one of the bookmarked directories (on the left side of the window) and then start typing to search. This will invoke a recursive search similar to Nautilus behavior. – mchid Oct 23 '22 at 16:25
  • @Chloé But again, I think xdg-desktop-portal-gtk uses GtkFileChooser. There is one thing you can try. Go to about:config in firefox and search for xdg-desktop-portal.file-picker and change the value from 2 to 1. Then, restart firefox. At one point, I believe this made a difference for me but then it was back to the old behavior. I use nightly so it might be a recent update that isn't applied to older versions (and the snap version may handle this differently). – mchid Oct 23 '22 at 16:34
  • @Chloé And FYI, xdg-desktop-portal.file-picker is not the full key name, but that search should bring up the one you need. – mchid Oct 23 '22 at 16:40
  • 1
    @mchid thanks for all these explanations. Sadly, the value of this key is currently 1. I guess I changed it at some point during my hours of research on the matter... – Chloé Oct 24 '22 at 17:47

1 Answers1

1

Imagining this is related to my case:

Look at /usr/share/dbus-1/services/ and find:

 org.xfce.FileManager.service
 org.xfce.Thunar.FileManager1.service

Because I was using Dolphin on Kubuntu I had also org.kde.dolphin.FileManager1.service. I have copied the line SystemdService=plasma-dolphin.service from the "dolphin" file into the other two, replacing the corresponding "thunar" lines there.

In your case you should use the variables corresponding to your case, involving "nautilus".

They might look like so:

org.xfce.FileManager.service:

[D-BUS Service]
Name=org.xfce.FileManager
Exec=/usr/bin/Thunar --gapplication-service
SystemdService=nautilus.service

org.xfce.Thunar.FileManager1.service:

[D-BUS Service]
Name=org.freedesktop.FileManager1
Exec=/usr/bin/Thunar --gapplication-service
SystemdService=nautilus.service

I am not sure about org.gnome.Nautilus.service: but maybe something like:

[D-BUS Service]
Name=org.freedesktop.FileManager1
Exec=/usr/bin/nautilus --daemon
SystemdService=nautilus.service

Other solutions from my sources (see link), which I haven't tested but are confirmed to work:

  • running killall Thunar at login

  • running systemctl --user mask thunar

I think these solutions cannot be used on a desktop like Xfce (where Thunar is handling the desktop) without further settings that would fully replace Thunar's functions.

cipricus
  • 3,444
  • 2
  • 34
  • 85
  • My problem is that I don't have such "SystemdService" line in my org.gnome.Nautilus.service file... I tried systemcl status <service> with nautilus.service, org.gnome.Nautilus.service and gnome.nautilus.service (in place of <service>) but none was a valid service. Is Nautilus even a service ?

    I confirm that I cannot kill Thunar, otherwise my desktop icons don't work anymore (among other things). Also tried solution proposed there without success...

    – Chloé Sep 22 '22 at 20:08
  • @Chloé - for your needs related to uninstaling or killing Thunar, this might be helpful. - Considering I don't have such "SystemdService" line: what happens if you create the files that you don't have? I will post detail contents in my answer. I see here that nautilus.service should exist. – cipricus Sep 22 '22 at 21:39
  • As a workaround: I think Thunar is rather limited comparatively, but not compared to Nautilus. On the GTK side I find Nemo the most complete file manager (and the one that vaguely stands comparison to Dolphin). I have posted in the previous comment a link to a post I wrote when using Nemo to replace Thunar in Xfce. I am not sure if the solution is similar for Nautilus but Nemo is similar to Nautilus - maybe. – cipricus Sep 22 '22 at 22:02
  • Thanks for the link. However Nautilus doesn't have the desktop icons capacity anymore so I depend on Thunar to deal with this... / I've added SystemdService=nautilus.service on each file mentioned in your answer, and that didn't change a thing. Kinda hopeless about this, especially after reading the [bugzilla] page(https://bugzilla.mozilla.org/show_bug.cgi?id=1285711) you mentioned in another answer. – Chloé Sep 25 '22 at 14:08
  • I think Nemo (which is a Nautilus fork) has the desktop icons capacity... so I don't think the solution could apply to Nautilus. I thought about changing for Nemo and installed it, but I don't like how it looks (so I removed it straight after). I think I'll have to leave with this Firefox-open-in-folder downside (: – Chloé Sep 25 '22 at 14:11