Nautilus not working properly due to missing PATH in dbus

I am using Hyprland with wofi to run apps.
When I open nautilus using wofi, it cannot find any app to open files (except VLC, for some reason I have no clue why). If I go to the “Open With…” dialog, only VLC is present.

Apparently, this is due to the PATH env var missing in dbus, since if I do dbus-update-activation-environment PATH then nautilus works as expected.

Is there something that I am missing to make this work without having to explicitly import PATH?

Your desktop environment should run that program, otherwise D-Bus activated applications will not have access to your session environment.

For window managers, the display manager session script does it:

But if you do not use a display manager, you will need to call it yourself.

1 Like

Actually, it looks like Hyprland does call dbus-update-activation-environment, it just does not include PATH and XDG_DATA_DIRS, which are necessary for application launchers and file associations.

There is an upstream issue about that: Import environment variables into systemd in NixOS modules · Issue #2800 · hyprwm/Hyprland · GitHub Also Xwayland applications don't startup when launching them from `nautilus` · Issue #2965 · hyprwm/Hyprland · GitHub

1 Like

Thanks! I don’t know how I missed those two issues.
I was a bit afraid that passing PATH to dbus was not the proper thing to do, but if it is ok, then I’ll just do that. Thanks!

Actually, I just noticed that you said “But if you do not use a display manager, you will need to call it yourself.”.
I do use GDM, so it should do that for me?

I meant that if your desktop environment does not do it and you use display manager, you can use services.xserver.updateDbusEnvironment NixOS option to have the session script generated by the display manager NixOS module do it for you.

Ohh, right! That works!
Thanks a lot once again.