The primary screencasting interface that niri offers is through portals and pipewire.
It is supported by [OBS], Firefox, Chromium, Electron, Telegram, and other apps.
You can screencast both monitors and individual windows.
In order to use it, you need a working D-Bus session, pipewire, `xdg-desktop-portal-gnome`, and [running niri as a session](./Getting-Started.md) (i.e. through `niri-session` or from a display manager).
On widely used distros this should all "just work".
Alternatively, you can use tools that rely on the `wlr-screencopy` protocol, which niri also supports.
There are several features in niri designed for screencasting.
Let's take a look!
### Block out windows
You can block out specific windows from screencasts, replacing them with solid black rectangles.
This can be useful for password managers or messenger windows, etc.

This is controlled through the `block-out-from` window rule, for example:
```kdl
// Block out password managers from screencasts.
window-rule{
matchapp-id=r#"^org\.keepassxc\.KeePassXC$"#
matchapp-id=r#"^org\.gnome\.World\.Secrets$"#
block-out-from"screencast"
}
```
You can similarly block out layer surfaces, using a layer rule:
```kdl
// Block out mako notifications from screencasts.
layer-rule{
matchnamespace="^notifications$"
block-out-from"screencast"
}
```
Check [the corresponding wiki section](./Configuration:-Window-Rules.md#block-out-from) for more details and examples.
If the cast target disappears (e.g. the target window closes), the stream goes back to empty.
All dynamic casts share the same target, but new ones start out empty until the next time you change it (to avoid surprises and sharing something sensitive by mistake).
The [`is-window-cast-target=true` window rule](./Configuration:-Window-Rules.md#is-window-cast-target) matches windows targeted by an ongoing window screencast.
When screencasting browser-based presentations like Google Slides, you usually want to hide the browser UI, which requires making the browser fullscreen.
This is not always convenient, for example if you have an ultrawide monitor, or just want to leave the browser as a smaller window, without taking up an entire monitor.
The `toggle-windowed-fullscreen` bind helps with this.
It tells the app that it went fullscreen, while in reality leaving it as a normal window that you can resize and put wherever you want.
```kdl
binds{
Mod+Ctrl+Shift+F{ toggle-windowed-fullscreen;}
}
```
Keep in mind that not all apps react to fullscreening, so it may sometimes look as if the bind did nothing.
Here's an example showing a windowed-fullscreen Google Slides [presentation](https://youtu.be/Kmz8ODolnDg), along with the presenter view and a meeting app:
