Mirroring a Wayland desktop region for easy screen sharing

I'm a desktop Linux user — specifically Debian GNU/Linux with GNOME and Wayland. I also do a fair number of video calls involving screen sharing. And I have an ultra-wide screen monitor (32:9).

This can sometimes be a challenging combination. I want to share a portion of my screen and any window shown there, but most of the software I use only supports sharing either a single window, or an entire monitor.

If I share a single window, it's annoying to share a different window every time I need to show something else. If I share the entire monitor, the aspect ratio means the other participants will have a pretty bad time watching it.

Year of screen sharing on the Linux Desktop

Wayland has been around for almost 20 years, but the support in the wider ecosystem is still spotty. One reason is enhanced security (or — introducing any security at all) compared to the old X11 protocol, which breaks some use cases, screen sharing being one of them.

The Wayland way to do screen sharing is through PipeWire and XDG Desktop Portal. In a nutshell, the application that wants access to the screen asks the environment, which checks with the user (through a modal dialog) and then allows limited access.

The access can be to a single window, a region of the desktop, or a monitor — but most of the apps only support single window or entire monitor share. Not sure why: perhaps the region share is a relatively new addition most apps haven't picked up yet.

In any case, it's pretty annoying, and searching on the internet didn't yield any easy workaround. So I built one.

Waymirror

My workaround was to build a small app that uses the same components to get access to a selected region, then simply show that in a window. Other apps can then screen-share that window.

The app is called Waymirror and is available from PyPI and GitHub. If you want to try it out, note it depends on a number of GNOME and FreeDesktop system dependencies.