Missing FileChooser dbus interface when running Gnome with GDM disabled

Hey all,

So lately I’ve been having fun building a bootleg steam machine for my living room and things have been going fine for the most part. To get the experience I’m going for I use Jovian to set up auto-login to steam’s gamescope-session and then use gnome as the desktop session. Configuration can be seen here.

In order for auto-login to gamescope to work Jovian checks that you don’t have some DM installed so I made sure to have GDM disabled. As far as I can tell this has caused an issue with a couple applications not being able to find the org.freedesktop.portal.FileChooser dbus interface. This is not something I’ve had to mess around with much before so It may be some other config option doing it, but as far as I can tell not enabling GDM is the main difference in how I’m setting up gnome between my machines.

Checking d-spy it seems like a lot of interfaces are missing from org.freedesktop.portal.Desktop which are present on my main machine that does enable GDM. I can see org.freedesktop.impl.portal.gnome/gtk both being loaded with the interfaces I would expect and applications like Firefox are able to open file chooser dialogues, however those interfaces aren’t making it into the org.freedesktop.portal.Desktop bus.

Trying to find a solution I found these issues which seemed like what I wanted but manually including xdg-desktop-portal-gtk didn’t fix anything and that all looks to all be set up by enabling gnome anyway. I tried following things on the arch wiki to get a portals.conf file set up with the default to gtk but that didn’t seem to resolve things either. Looking at the nixpkgs module for GDM I’m not seeing anything obvious that touches portals but there’s probably something I’m missing.

I’m not exactly sure what needs to happen for this interface to get picked up properly. For context, the first place I ran into issues was with file pickers in ryujinx, and then later I noticed this in steam’s CEF logs while trying to figure out why decky-loader wasn’t working.

I’m sure I’m just missing a little bit of config to point things at each other, but any help figuring this out would be very appreciated.

Messed around with it a bit more and I think I have an idea what may be happening. I tried diffing the results of sudo strings /proc/(systemctl --user show --property MainPID --value xdg-desktop-portal)/environ against my main pc where things worked. Somehow this PC is picking up XDG_DESKTOP_PORTAL_DIR= from somewhere, and this makes that sound like a likely culprit for my original issue.

Switching jovian.steam.autoStart=false and re-enabling GDM made XDG_DESKTOP_PORTAL_DIR= go away and things started working again. Not seeing anything too obvious in jovian that would define that variable so still have to figure out where it’s coming from. Not sure if there is a clean way to unset a variable so I’ll probably have to track down what’s setting it with no value like that.

Seems like manually setting environment.sessionVariables.XDG_DESKTOP_PORTAL_DIR = "/run/current-system/sw/share/xdg-desktop-portal/portals"; does the trick for the original issue.

Still not entirely sure where the XDG_DESKTOP_PORTAL_DIR= is coming from but it looks very similar to what is happening here. Couldn’t find a place where jovian/gamescope were doing that explicitly but I’d imagine the gamescope session is somewhere. Will have to root around a bit more at somepoint to figure out why they’re doing that, but hey, portals are working in desktop mode now. Decky is still not loading though.