Firefox using Thunar insted of default file manager (XFCE)

When I try to open the containing folder of downloaded files in Firefox, it opens Thunar instead of Nemo. I already set Nemo as the default File Browser, but Firefox still uses Thunar.

After googling the issue i tried to run xdg-mime query default inode/directory to verify that it outputs nemo.desktop

How can I resolve this issue?

What happens if you run

xdg-mime default nemo.desktop inode/directory

in a terminal window?

Does it solve your issue?

I already tried that and it did not solve it.

I have the same problem but instead of Nemo it’s Nautilus.

1 Like

I just noticed something.
When I go into Session and Startup and I quit Thunar there, Firefox then opens the download location with Nemo just as it is supposed to. But this is not a permanent fix. After restarting Firefox, it reverts right back to Thunar and now Thunar is not even shown in Session and Startup. I have a feeling this has something to do with a daemon running for Thunar but I’m not sure.

Perhaps this can help someone here to come closer to the solution?

When I was using SpaceFM as default file manger, I used to run “killall Thunar” at startup/login to kill the Thunar daemon.

That also didn’t do the trick. The daemon thing was just a thought I had.

I went searching to see how I solved this, and found I had added a line to /home/[user]/.local/share/applications/mimeapps.list

inode/directory=spacefm.desktop;

Change “spacefm.desktop” to whatever file manager launcher you wish and Firefox should use that to open containing folder. I just tried it and it works for me.

Still no luck. According to the Arch Wiki there are multiple location that could be the case. But adding

1 [Default Applications]
2 inode/directory=nemo.desktop;

in any of these location still has no effect. I feel like this option is buried somewhere deeper in the Manjaro defaults

https://wiki.archlinux.org/index.php/XDG_MIME_Applications#mimeapps.list

There’s also inode/directory entries in the mimeinfo.cache files in /usr/share/applications and /home/[user]/.local/share/applications. You could check those and list your preferred file manager first.

I also tried that but it still doesn’t work.

Mozilla has an open bug report about this
1285711 - Firefox does not use default file manager | bugzilla.mozilla.org

Comments suggest that using Open Containing Folder in the right-click context menu for the downloaded file will use the correct File Manager

1 Like

One person stated that he also experienced that problem with Chrome. Indeed I noticed that I had the same problem with chromium, so I guess this is not Firefox related. Needless to say that using “Open Containing Folder” didn’t solve it.

EDIT: I think I managed to solve it thanks to @nikgnomic link.

I figure out that it is due to the use of the org.freedesktop.FileManager1 d-bus service from https://dxr.mozilla.org/mozilla-central/source/toolkit/system/gnome/nsGIOService.cpp#578 . The solution is to change the implementation of the d-bus service (see /usr/share/dbus-1/services/org.xfce.Thunar.service).

For example, for Thunar we have the following in /usr/share/dbus-1/services/org.freedesktop.FileManager1.service:
[D-BUS Service]
Name=org.freedesktop.FileManager1
Exec=/usr/bin/Thunar --gapplication-service
SystemdService=thunar.service

I changed /usr/share/dbus-1/services/org.xfce.FileManager.service to contain the following content:

[D-BUS Service]
Name=org.freedesktop.FileManager1
Exec=/usr/bin/nemo --no-default-window
SystemdService=nemo.service

I don’t think this is the cleanest of solutions but it works! So I have to ask: IS THIS SAFE TO DO?

File /usr/share/dbus-1/services/org.xfce.FileManager.service is owned by Thunar
A future update could revert the service back to Thunar
So you should check after an update to see if the service needs to be edited again

grep -A1 Exec /usr/share/dbus-1/services/org.xfce.FileManager.service

On second thought I have to say that this solution in combination with running “killall thunar” at startup WILL break your desktop icons. The desktop will work normal again when I have an instance of Thunar running and stop working again, when it is closed. Trying to click on icons on the desktop will just prompt with the following error:

GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name org.xfce.FileManager was not provided by any .service files

How can I retain my desktop functionality with this solution?