Dear all,

after a few hours of debugging I finally managed to get it working and I'd like to share my insights:

First of all
```
(service home-pipewire-service-type)
(service home-dbus-service-type)
```
should be in the home environment and packages `xdg-desktop-portal` and
`xdg-desktop-portal-wlr` should be installed.

Basically everything else is then handled by `dbus`. But for this to work, `dbus` must know about the current desktop environment. This is accomplished by putting
```
$HOME/.guix-home/profile/bin/dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP=sway >/dev/null 2>&1
```
into `.config/sway/config`. The `XDG_CURRENT_DESKTOP=sway` is necessary unless you define `XDG_CURRENT_DESKTOP` in your login shell.

Now everything is set up and should work unless you sabotage the process like I did. `xdg-desktop-portal` and `xdg-desktop-portal-wlr` are automatically activated by `dbus` as soon as `org.freedesktop.portal.ScreenCast` is requested on the bus.

If you start the portals manually before they are requested it will not work unless you set the environment variable `XDG_CURRENT_DESKTOP=sway` before starting the portals. That's because otherwise the `ScreenCast` request is sent to the `xdg-desktop-portal` and `xdg-desktop-portal` doesn't know which implementation it should use now since it doesn't know the desktop it's running on.

Best regards
Alex

On Thu, Jan 15 2026, 17:26:18, Alexander Asteroth <[email protected]> wrote:

Hi Rutherther,

I checked and both xdg-desktop-portal and xdg-desktop-portal-wlr are
running and can be accessed on the dbus.
xdg-desktop-portal-wlr has the property ScreenCast that is asked for by firefox but the property is not exposed by xdg-desktop-portal. I'm currently checking why that is so. I killed and restarted both (in both orders) but the result remains. firefox askes xdg-desktop-portal
for property ScreenCast and then sharing failes. Cheers
Alex

On Thu, Jan 15 2026, 16:40:58, Rutherther <[email protected]>
wrote:

Hi,

Alexander Asteroth <[email protected]> writes:

Hi Rutherther,

thanks a lot for your explanations. After removing
exec $HOME/.guix-home/profile/libexec/xdg-desktop-portal -r
/dev/null 2>&1 &
exec $HOME/.guix-home/profile/libexec/xdg-desktop-portal-wlr -r
/dev/null 2>&1 &

and starting sway without dbus-run-session screensharing worked
under jitsi in firefox.
I stopped sway logged out and started it again and it still worked.

I should have stopped then and be happy but I continued...

Next thing I tried was if I can also remove
$HOME/.guix-home/profile/bin/dbus-update-activation-environment
--systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP=sway >/dev/null 2>&1

Right, you cannot remove that. Then xdg-desktop-portal doesn't know. What the display is (WAYLAND_DISPLAY) neither that it should use wlr
(XDG_CURRENT_DESKTOP).


or `(service home-pipewire-service-type)`.

Pipewire service is a dependency of xdg desktop portal wlr
implementation, so also not surprising.


Neither worked, so I put both in again and guess what,
screensharing doesn't work.
I logged out, rebooted, repeated the first steps, nothing helps.

So `herd status pipewire` now returns it's running, is that right?


I tried to debug the dbus while trying to activate
screensharing. There is an error, when I try to actiate
screensharing but I'm not a dbus expert so I have no idea what goes
wrong.
error time=1768490440.178991 sender=:1.35 -> destination=:1.34 error_name=org.freedesktop.DBus.Error.InvalidArgs reply_serial=136
   string "No such interface
“org.freedesktop.portal.ScreenCast”"

Sounds like xdg-desktop-portal got uninstalled. Are you sure you
still
have
`$HOME/.guix-home/profile/share/dbus-1/services/org.freedesktop.portal.Desktop.service`?

If so, try starting `xdg-desktop-portal` with -rv and reply with the
log
you got out of that. In case it starts working after you start it
manually, it likely means the original process did not have the
right
environment that you tried to set.

That can happen in case an application tries to request any of the
interfaces prior to you running
`dbus-update-activation-environment`.
Ensure that is the first thing that runs prior to any programs.

Rutherther

Reply via email to