You are not logged in.
I want to use xdg-desktop-portal-gnome with Labwc. I mainly want it for the file-picker.
This is my portals configuration file (.config/xdg-desktop-portal/labwc-portals.conf):
[preferred]
default=xdg-desktop-portal-wlr
org.freedesktop.impl.portal.FileChooser=xdg-desktop-portal-gnomeWhen I try to start the "Open file" dialog, nothing happens. If I manually run /usr/lib/xdg-desktop-portal-gnome, it works and the file picker opens.
This is the error message I see for the xdg-desktop-portal-gnome.service:
Apr 22 10:58:03 masina-l systemd[1054]: Dependency failed for Portal service (GNOME implementation).
Apr 22 10:58:03 masina-l systemd[1054]: xdg-desktop-portal-gnome.service: Job xdg-desktop-portal-gnome.service/start failed with result 'dependency'.Looking at the xdg-desktop-portal-gnome.service file I see that it requires the graphical-session.target:
[Unit]
Description=Portal service (GNOME implementation)
After=graphical-session.target
Requisite=graphical-session.target
PartOf=graphical-session.target
[Service]
Type=dbus
BusName=org.freedesktop.impl.portal.desktop.gnome
ExecStart=/usr/lib/xdg-desktop-portal-gnomeThat target is indeed not running my session. I wanted to replace it with the target that I use in my session: a custom one started by Labwc once it starts up.
I used a systemd override file with this content:
[Unit]
After=
After=user-graphical.target
Requisite=
Requisite=user-graphical.target
PartOf=
PartOf=user-graphical.targetThat doesn't fix it though. I am still getting the same error. If I completely replace the service file with a new one in .config/systemd/user/xdg-desktop-portal-gnome.service and define After=, Requisite= and PartOf= with user-graphical.target, it works.
My questions are:
1. Why doesn't overriding work? Why do I need a completely new file?
2. Is this the best way to get this to work in Labwc? Am I approaching this the wrong way? Is there a better way to get the file picker from GNOME outside of GNOME?
Last edited by justasug (2025-04-26 13:43:16)
Offline
xdg-desktop-portal-gtk should have the gtk picker, afaik gnome really only truly works on gnome
Offline
xdg-desktop-portal-gtk should have the gtk picker, afaik gnome really only truly works on gnome
The GTK file picker works with xdg-desktop-portal-gtk. I wanted the GTK4/Nautilus one, which has the icon view with big thumbnail support.
I managed to fix this by editing my custom target to pull in graphical-session.target.
BindsTo=graphical-session.target
Wants=graphical-session-pre.target
After=graphical-session-pre.targetNow starting my custom target via Labwc's autostart file also starts graphical-session.target, which in return starts the xdg-desktop-portal-gnome service file. A quick test of Firefox's Open File dialog shows the GTK4/Nautilus filepicker. This seems like an acceptable, clean solution for me.
I still don't know why overriding the service file of xdg-desktop-portal-gnome didn't work though.
Offline