---
title: 'Screen sharing with sway'
url: 'https://discocat.me/blog/screen-sharing-with-sway'
markdown: 'https://discocat.me/blog/screen-sharing-with-sway.md'
date: '2025-07-02'
description: 'So, sway is an awesome window manager, but to stream/screenrecord correctly without black flashes... you need to disable something called direct scanout. To do this, you must pass an environment variable in the config file used by login managers to start sway. It is located at /usr/share/wayland-se…'
---

# Screen sharing with sway

So, sway is an awesome window manager, but to stream/screenrecord correctly without black flashes... you need to disable something called direct scanout.

To do this, you must pass an environment variable in the config file used by login managers to start sway.

It is located at `/usr/share/wayland-sessions/sway.desktop`

Here is what works :

```
[Desktop Entry]
Name=Sway
Comment=An i3-compatible Wayland compositor
Exec=env WLR_RENDERER=vulkan WLR_SCENE_DISABLE_DIRECT_SCANOUT=1 sway
Type=Application
```

As you can see, I also force the renderer for the desktop to be vulkan instead of OpenGL, but that shouldn't be needed to fix the issue when screen recording.

---

## Navigation

- Parent: [Blog](https://discocat.me/blog.md)
- Previous: [Chroot linux (with or without btrfs subvolumes)](https://discocat.me/blog/chroot-archlinux-with-or-without-btrfs-subvolumes.md)
- Next: [Arch, btrfs, snapper and btrfs-assistant](https://discocat.me/blog/arch-btrfs-snapper-and-btrfs-assistant.md)
