You are not logged in.

#1 2021-06-27 16:34:51

tigerjack
Member
Registered: 2017-08-20
Posts: 87

Screen sharing on sway

I read a lot of posts on the subject, but I am still unable to properly share my screen on sway. I've installed pipewire-media-session and xdg-desktop-portal-wlr, but also libpipewire02 for chromium support. I have this loaded environment variables

$>systemctl --user show-environment 
HOME=/home/simone
LANG=en_US.UTF-8
LOGNAME=simone
MAIL=/var/spool/mail/simone
PATH=/usr/local/bin:/usr/bin
SHELL=/bin/bash
SSH_AUTH_SOCK=/run/user/1000/ssh-agent.socket
SYSTEMD_EXEC_PID=1222
USER=simone
XDG_RUNTIME_DIR=/run/user/1000
DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus
DISPLAY=:0
SWAYSOCK=/run/user/1000/sway-ipc.1000.70330.sock
WAYLAND_DISPLAY=wayland-1
XDG_CURRENT_DESKTOP=sway
XDG_SESSION_TYPE=wayland

and my sway config contain the line

include /etc/sway/config.d/*

which include the file

 /etc/sway/config.d/50-systemd-user.conf

containing

exec systemctl --user import-environment DISPLAY WAYLAND_DISPLAY SWAYSOCK
exec hash dbus-update-activation-environment 2>/dev/null && \
     dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK

The systemd services pipewire and pipewire-media-session are active(running), while xdg-desktop-portal-wlr is loaded but inactive (I guess it should start automatically when screen-sharing is enabled). If I try to start xdg-desktop-portal-wlr I get either

Jun 27 14:41:08 azenb systemd[1222]: Starting Portal service...
Jun 27 14:41:33 azenb xdg-desktop-por[2000]: Failed to create screenshot proxy: Error calling StartServiceByName for org.freedesktop.impl.portal.desktop.wlr: Timeout was reached
Jun 27 14:41:33 azenb xdg-desktop-por[2000]: No skeleton to export
Jun 27 14:41:58 azenb xdg-desktop-por[2000]: Failed to create screen cast proxy: Error calling StartServiceByName for org.freedesktop.impl.portal.desktop.wlr: Timeout was reached
Jun 27 14:41:58 azenb xdg-desktop-por[2000]: No skeleton to export
Jun 27 14:41:58 azenb systemd[1222]: Started Portal service.

or

Jun 27 18:31:35 azenb systemd[1222]: Stopping Portal service (wlroots implementation)...
Jun 27 18:31:35 azenb systemd[1222]: xdg-desktop-portal-wlr.service: Deactivated successfully.
Jun 27 18:31:35 azenb systemd[1222]: Stopped Portal service (wlroots implementation).
Jun 27 18:31:35 azenb xdg-desktop-portal-wlr[104368]: 2021/06/27 18:31:35 [ERROR] - config: no config file found
Jun 27 18:31:35 azenb systemd[1222]: Starting Portal service (wlroots implementation)...
Jun 27 18:31:35 azenb systemd[1222]: Started Portal service (wlroots implementation).

I'm trying to get the screen sharing working on Firefox, Chromium, OBS studio and (ideally) the most recent teams application (I don't know if it's feasible though). I went through the whole checklist shown here https://github.com/emersion/xdg-desktop-portal-wlr/wiki/%22It-doesn't-work%22-Troubleshooting-Checklist and the xdg-desktop-portal seems to be the only one failing.

Any help is appreciated.

Last edited by tigerjack (2021-06-27 16:36:13)

Offline

#2 2021-07-13 06:49:45

tigerjack
Member
Registered: 2017-08-20
Posts: 87

Re: Screen sharing on sway

bump

Offline

#3 2021-07-13 17:49:46

snakeroot
Member
Registered: 2012-10-06
Posts: 171

Re: Screen sharing on sway

Note that 50-systemd-user.conf imports only "DISPLAY WAYLAND_DISPLAY SWAYSOCK" into the dbus environment.

Item 5 of the Troubleshooting Checklist includes "XDG_CURRENT_DESKTOP=sway":

dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP=$compositor_name

where, in this context, $compositor_name would be "sway".

FWIW, I'm using sway-systemd which imports "DISPLAY I3SOCK SWAYSOCK WAYLAND_DISPLAY XDG_CURRENT_DESKTOP XDG_SESSION_TYPE".

While this may be overkill, on my system systemctl --user shows xdg-desktop-portal-wlr service as "active (running)" and I've been able to successfully test the screencasting functionality on the Mozilla test page.

Offline

Board footer

Powered by FluxBB