From fd50acf48408d70ec85d4fcb5b436fc908b9d3a1 Mon Sep 17 00:00:00 2001 From: Andreas Tsouchlos Date: Sun, 15 Mar 2026 10:21:40 +0100 Subject: [PATCH] sysadmin/troubleshooting-screen-sharing.md --- sysadmin/troubleshooting-screen-sharing.md | 47 ++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 sysadmin/troubleshooting-screen-sharing.md diff --git a/sysadmin/troubleshooting-screen-sharing.md b/sysadmin/troubleshooting-screen-sharing.md new file mode 100644 index 0000000..26d8afd --- /dev/null +++ b/sysadmin/troubleshooting-screen-sharing.md @@ -0,0 +1,47 @@ +# Screen sharing + +"We use `xdg-desktop-portal` (+ backend implementation) for communication +between the app requesting to share a screen and between desktop (Plasma or +Gnome)." [1] (or in this case, sway). See also [2]. + +**System info** + +``` +=== Kernel === +6.18.18-1-lts +=== Sway === +sway version 1.9 +=== xdg-desktop-portal (installed packages) === +xdg-desktop-portal 1.20.3-2 +xdg-desktop-portal-wlr 0.8.1-1 +xdg-desktop-portal-gtk 1.15.3-1 +``` + +**Logs** + +``` +Mar 15 09:22:00 andreas-laptop systemd[1178]: xdg-desktop-portal-gtk.service: Start request repeated too quickly. +Mar 15 09:22:00 andreas-laptop systemd[1178]: xdg-desktop-portal-gtk.service: Failed with result 'exit-code'. +Mar 15 09:22:00 andreas-laptop systemd[1178]: Failed to start Portal service (GTK/GNOME implementation). +Mar 15 09:22:00 andreas-laptop /usr/lib/xdg-desktop-portal[1347]: Failed to ReadAll() from Settings implementation: GDBus.Error:org.freedesktop.DBus.Error.NameHasNoOwner: Could not activ> +``` + +**Solution** + +We first have to tell `xdg-desktop-portal` that it should use the wlr backend +to route screen capture requests. In `~/.config/environment.d/sway.conf` add +``` +XDG_CURRENT_DESKTOP=sway +``` + +We also have to set up the link between the wayland compositor and +`xdg-desktop-portal`. In `~/.config/sway/config`, add +``` +exec systemctl --user import-environment DISPLAY WAYLAND_DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP +exec dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP +``` + +## References + +1. https://jgrulich.cz/2018/07/04/how-to-enable-and-use-screen-sharing-on-wayland/ +2. https://wiki.archlinux.org/title/XDG_Desktop_Portal