I spent some time trying to get things to work and in the end I decided to compile the instructions in a compact and coherent guide.
- Install Chromium
81.0.4044.122or later, or Firefox
pipewire, and if you’re using Chromium,
libpipewire02as well. If you’re using Arch, both packages are available in the official repositories.
xdg-desktop-portal-wlr. It is available in the official Arch repositories.
- If you’re running Firefox, make sure that
MOZ_ENABLE_WAYLAND=1is set before you start it to make sure it’s running natively. If you’re using Chromium, start it with the following flags, for the same reason:
chromium --enable-features=UseOzonePlatform --enable-gpu --ozone-platform=wayland.
- If you’re running Chrome, enable
- Make sure that the environment variables
XDG_CURRENT_DESKTOP=swayare set and exported - it doesn’t work without them.
- From the shell, run:
$ /usr/lib/xdg-desktop-portal -r & /usr/lib/xdg-desktop-portal-wlr. This will run the former as a background job, so don’t close your shell.
- Run your browser.
- Profit, screen sharing should now work (I tested it in both FF and Chromium and it works on discordapp.com). You can also test if it works here.