Hi, For some time, I have had a problem with screen sharing/capturing in Sway. I tested it using both Firefox and Chromium with Google Meet and this test page: https://mozilla.github.io/webrtc-landing/gum_test.html. I went through the troubleshooting checklist (available here: https://github.com/emersion/xdg-desktop-portal-wlr/wiki/%22It-doesn't-work%22-Troubleshooting-Checklist) to find out that xdg-desktop-portal.service is not started. Not that it fails. It is not even being attempted. How can I make it start? Below is what I tried. I noticed that xdg-desktop-portal.service is a "PartOf" graphical-session.target, so I configured my sway.target to bind to the graphical session. The Sway target is started in the Sway configuration, which includes a slightly modified 50-systemd-user.conf available in the Arch package: --- 50-systemd-user.sh --- # Upstream refuses to set XDG_CURRENT_DESKTOP so we have to. exec systemctl --user set-environment XDG_CURRENT_DESKTOP=sway exec systemctl --user import-environment DISPLAY \ SWAYSOCK \ WAYLAND_DISPLAY \ XDG_CURRENT_DESKTOP exec hash dbus-update-activation-environment 2>/dev/null && \ dbus-update-activation-environment --systemd DISPLAY \ SWAYSOCK \ XDG_CURRENT_DESKTOP=sway \ WAYLAND_DISPLAY \ PATH exec systemctl --user start sway.target --- The sway.target is very simple: --- (~)$ cat .config/systemd/user/sway.target [Unit] Description=Sway target AllowIsolate=yes BindsTo=graphical-session.target --- This changed nothing, so I tried to start xdg-desktop-portal manually to find out that it ends with a core dump. Logs attached. Not sure if this is related to the problem that the service is not started or if it is an unrelated issue. Any advice? Thanks, Radek
I discovered that the issue has nothing to do with xdg-desktop-portal. Other D-Bus activated services also does not start. I assume this has something to do with the lack of the DBUS_SESSION_BUS_ADDRESS environment variable. I tried to import it from systemd (using exec systemctl --user import-environment DBUS_SESSION_BUS_ADDRESS in the Sway configuration), but this didn't help. The variable is there, but services still are not activated. The only way for me is to use dbus-launch (eg dbus-launch notify-send or eval $(dbus-launch)). What is the proper way to get this variable set? I start Sway from .bashrc: if [ -z $DISPLAY ] && [ "$(tty)" = "/dev/tty1" ]; then export XDG_CURRENT_DESKTOP=sway exec systemd-cat --identifier=sway sway fi Best regards, Radek
Hi Radek,
I discovered that the issue has nothing to do with xdg-desktop-portal. Other D-Bus activated services also does not start.
Does this help? Note: The user configuration is expected to contain include /etc/sway/config.d/* in order to apply configuration snippets from drop-in files. The sway package provides the 50-systemd-user.conf drop-in file, which imports several environment variables into the systemd user session and dbus. This is required for several applications such as xdg-desktop-portal-wlr. — https://wiki.archlinux.org/title/Sway#Configuration -- Cheers, Ralph.
On Wed Jun 18, 2025 at 1:05 PM CEST, Ralph Corderoy wrote:
Hi Radek,
I discovered that the issue has nothing to do with xdg-desktop-portal. Other D-Bus activated services also does not start.
Does this help?
No, it's not that. I already have 50-systemd-user.conf included in my Sway config. I dug into the topic a little more. I switched from dbus-broker-units to dbus-daemon-units, and services can now be activated via dbus (both dunst.service and xdg-desktop-portal.service with its backends work). Unfortunately, this creates other problems mainly with responsiveness. For example, Chromium needs around 20 seconds to start and even 20 more to resolve the first domain. After that, it is quite fast. seahorse (GNOME UI for accessing gnome-keyring) timeouts (even though gnome-keyring-daemon.service is enabled and started; as far as I understand the config files, it is not supposed to be D-Bus activated). I tried for the second time, and it worked, but not in a way that I could read a password. There were other similar problems, so I switched back to dbus-broker-units. The described problems are gone, but dunst.service and xdg-desktop-portal (and probably others) are again not activatable via D-Bus. Any idea what might be the problem with dbus-broker that it does not activate services? Best, Radek
Hi Radoslaw, This changed nothing, so I tried to start xdg-desktop-portal manually to
find out that it ends with a core dump. Logs attached.
On my machine with sway it start without any issues: Do you have the following package installed? $ pacman -Qs gsettings-desktop-schemas local/gsettings-desktop-schemas 48.0-1 GSettings schemas for GNOME desktop components Best, Matteo (loacker)
participants (3)
-
Matteo Piccinini
-
Radosław Kintzi
-
Ralph Corderoy