Browser still uses Thunar to open folders after I switched to Nemo

I’m using librewolf (firefox based), and after switching to Nemo over thunar, the browser will still open folders (for instance when you click the “show in folder” button for downloads) in thunar.

If I issue a “xdg-open” to a folder in the terminal it uses Nemo normally, seems to be only the browser doing this :man_shrugging:

I guess it’s some config file somewhere, anyone know what it could be?

Btw this is my first foray with arch, used Mint before for a while, been only using Linux for little over a year now.

Hello and welcome to :enos: forums.

These might help you.

1 Like

Thanks, that led me to many possible solutions

Unfortunately none of them worked :stuck_out_tongue: this thing just refuses to use anything other than Thunar.

Chromium opens up Nemo normally, it’s just librewolf… maybe If I install the other version of it, I’m using the prepackaged binary one.

I’ve edited all the mimeinfo.cache, and mimeapps.list files I could find, they’re all pointing to nemo.

I just felt like trying XFCE for a change, but more and more I feel like I should have just gone with cinnamon heh, it’s just that Nemo is so much better than Thunar in every possible way.

Eh, it’s just a minor nuisance anyway, I’ll keep trying to fix it and if I ever manage it I’ll post here in case it helps someone else.

I doubt you’re open to this thought :grin: - but in WHAT ways is nemo superior? I couldn’t find any, although I was expecting to (coming originally from 'buntus). Perhaps setting up Thunar in a way more compatible with your use could help? :duck:

You should try the other way around. Search for thunar, to see which protocols it is assigned to.

A proper solution would be to configure this with the xdg-desktop-portal method. Read similar suggestions, and try to understand how this works, so you might find a solution.
https://wiki.archlinux.org/title/Firefox#File_dialogs_do_not_open_when_downloading_files
https://wiki.archlinux.org/title/Firefox#KDE_integration

Or ask the browser developer :person_shrugging: .

Eh, I like the search in Nemo better, it has a nifty built-in search content function, also I like the way you can have a tree view everywhere (including for browsing files), and as far as I know you can’t have Thunar do that.

But yeah, it’s just personal preference.

Thx, I’ll have a look

1 Like

Always that (personal preference) - but I must admit I hadn’t noticed tree view in nemo when I tried it. As for search - I prefer having a fuzzy search and/or Catfish both available when in thunar…

TEHO, then… (to each etc)

It seems to be a bug as old as the hills; check out this bug report, seven years old and still open:

Try some of the hacky workarounds described in this thread: https://unix.stackexchange.com/questions/146904/set-new-default-file-manager-for-firefox-in-archlinux

3 Likes

Heh, well, at least it’s known-ish, they clearly don’t much care about it.

I tried all the possible fixes listed in that thread but unfortunately none worked.

But, like I said before, its just a minor nuisance, apparently there are cases where the browser gets stuck using something that’s not even a file browser, at least for me it uses Thunar.

1 Like

Are you confident you did all tests properly?
If not, post what you did in detail, and whatever commands you ran, file modifications, etc.

Alright, I found the culprit!

Thunar was being auto started in daemon mode:

process

And for that reason whenever trying to open a folder from librewolf it would use it instead of whatever was the system default, was happening in chrome too I found out, so it was most likely not related to that firefox issue I guess.

Found out by accident too, first I was like “wtf is this Thunar process doing here?” then killed it, and by chance happened use the “show in folder” right after doing this, and lo and behold, the thing used Nemo!

Then I had a bit of trouble figuring out how to disable the effen thing from auto starting, there was no entry in “Application autostart”, there were no units found using systemctl.

Then I found out it is a xfce session setting,

stored at /etc/xdg/xfce4/xfconf/xfce-perchannel-xml/xfce4-session.xml

      <property name="Client3_Command" type="array">
        <value type="string" value="Thunar"/>
        <value type="string" value="--daemon"/>
      </property>
      <property name="Client3_Priority" type="int" value="30"/>
      <property name="Client3_PerScreen" type="bool" value="false"/>

At first I tried just deleting this entry in the file, but even though it didn’t show in the session anymore, the process STILL got started somehow.

Then restored the backup I had made, and tried just setting the “restart cycle” to “never”, then saving the session, instead of editing the file, same result… somehow the process was still getting launched at login.

Then I found that, even though systemctl showed no unit for thunar at all, there was indeed a file named “thunar.service” under “/usr/lib/systemd/user/” which was, somehow, doing this… no service listed with systemctl or nothing…

Anyway, I just deleted the damn file and now it’s good.

Edit: found a downside for not having the daemon running, can’t do anything directly on desktop, can’t create/delete files, can’t use launchers.

Not that big of a deal for me anyway, I barely use the desktop, I prefer to have launchers on the panel, plus I don’t keep any files in there, but worth to note all the same.

I should just use Thunar :stuck_out_tongue: , I do really like Nemo’s tree view navigation though.

3 Likes

This is the source of the problem, because of librewolf/firefox.
The fact that Thunar is autostarted is an XFCE4 setting.

Did you search in the system, or in the user space? They list completely different services.
It can also be a dbus service, which you can find in journal:

journalctl --user -b | grep "Activating service name"

These are system files, and they can normally be overridden with a user account equivalent file (at $HOME/.
Deleting those files will not solve your issue permanently, and you will find it out as soon as you install an updated thunar/xfce package version, which will recreate it.
So, you should better uncheck Solved from this post :wink: .

This article ( posted above by @BluishHumility ) includes a proper explanation of what might be the problem, and the proper/best solution is the last post 2023-03-01T22:00:00Z IMHO, if I understood the problem correctly.

In short, firefox probably prefers an already running FileManager1 dbus service, if it exists. If not, it uses xdg mimeapps default.
So, you might solve it if you make thunar to not start as a daemon (dbus service). The default xfce file for this is usually copied in the equivalent $XDG_CONFIG_HOME/ path, and overrides the system setting (no need to delete it). Because this local file already exists, is probably the reason thunar was still starting after you deleted the system file.
Instead of editing the appropriate entry in a proper way, you should use a GUI instead. I suppose it is the one in your posted image from XFCE Settings Session. Change If running to Never, or something similar.
Unfortunately, this has consequences for your XFCE session, since there are reasons that XFCE runs this daemon. AFAIK it enables the Desktop Icons function, but also is used for fast response on thunar calls, or other file/folder actions-activities. It would be better to not disable this, if possible.
This is why disabling the dbus thunar service discovery would be a more appropriate solution (if it actually does the job :person_shrugging: ).

From the mentioned post:

  • Find thunar dbus service file path (thunar in the name)
ls /usr/share/dbus-1/services/*.FileManager1.service
  • Copy it in your $XDG_DATA_HOME folder with this name:
$XDG_DATA_HOME/dbus-1/services/org.freedesktop.FileManager1.service
  • Edit the Exec entry to this:
Exec=/usr/bin/false

Although this method might be a nice solution, I would personally prefer the desktop-portal method (needs proper implementation).

3 Likes

Sorry it took so long to respond.

Thx for clearing this all up for me, luckily I saved a backup of the system file I deleted so I can just restore it

And indeed, when I was checking systemctl for the unit I didn’t check the --user space, didn’t even know that was a thing heh.

Though, neither $XDG_CONFIG_HOME or $XDG_DATA_HOME seem to be set for me, so I don’t know where would be the full path to drop that file in, would it be something like ~/.config/xdg/?

NVM… I looked it up :stuck_out_tongue:

1 Like

If you test this proposed method, please, give feedback whether it works :wink: .

Most unfortunately it made no difference whatsoever…

I reverted everything back to the way it was (just cleared the saved session with Thunar process set to “Never”), and restored the deleted thunar.service to “/usr/lib/systemd/user/”

Sure enough after a logout/login the Thunar daemon was running again, and again the browser was using thunar.

Then I tried said method, not sure if I did right though

Found the file name “org.xfce.Thunar.FileManager1.service” in “/usr/share/dbus-1/services”, copied it over to “$HOME/share/dbus-1/services/” (had to manually create since it didn’t exist), renamed file to “org.freedesktop.FileManager1.service”

here’s the original contents:

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

Then I edited just the “exec” part to say “/usr/bin/false”

logged out/in, nothing had changed, the thunar daemon was running, and the browser used it instaed of nemo.

After that I tried having the file named “org.xfce.Thunar.FileManager1.service” as it is in the system folder, same thing, there’s another file under “usr/share/dbus-1/services/” called “org.xfce.Thunar.service” with the exact same contents, tried copying that over to the home directory counterpart and changing it, nothing.

Seems that as long as that thuar service is running in the background the browser will use it, period.

And the only way to stop it seems to set the running Thunar process restart cycle to “Never” then saving the session, and then deleting that thunar.service file, otherwise it gets started all the same, even if the session setting is set to never.

It does appear under systemctl user space, but you can’t disable it, here’s what I got when trying to:

The unit files have no installation config (WantedBy=, RequiredBy=, Also=,
Alias= settings in the [Install] section, and DefaultInstance= for template
units). This means they are not meant to be enabled or disabled using systemctl.

Possible reasons for having this kind of units are:
• A unit may be statically enabled by being symlinked from another unit’s
.wants/ or .requires/ directory.
• A unit’s purpose may be to act as a helper for some other unit which has
a requirement dependency on it.
• A unit may be started when needed via activation (socket, path, timer,
D-Bus, udev, scripted systemctl call, …).
• In case of template units, the unit is meant to be enabled with some
instance name specified.

A pesky thing this… I think I’ll just leave it as is

It’s a dbus service, not like usual systemd ones.

:person_shrugging:

Why don’t you try to stop Thunar daemon at the session start, by creating a program in “Application Autostart”.
The command is :

thunar -q

For test, run this command in a terminal and check if Librewolf use Nemo.

2 Likes

You know, usually the simpler solution ends up being the best one.

I thought about doing that before, but wanted to try and actually fix the issue if I could, but this ends up being the best and cleaner way to have it working the want it.

It does work, and without the thunar daemon running the browser uses Nemo, the only thing is if I try and create/open a file directly on desktop, or use a launcher, it immediately launches the thunar daemon again.

But I figure that’s better than getting the error message I got before when trying to do those things, when I had completely disabled it for good

Did you set your default file manager to Nemo in " Preferred Applications" ?

https://docs.xfce.org/xfce/xfce4-settings/preferred-apps