> For the complete documentation index, see [llms.txt](https://docs.monarchlinux.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.monarchlinux.com/everyday-tasks/screen-sharing-privacy.md).

# Screen sharing privacy

Mask common chat windows in Niri captures and silence notifications during screen sharing.

Monarch provides two independent protections: Niri masks selected messaging windows in captures it renders, and Noctalia switches to Do Not Disturb (DND) during an active Niri screen share or portal recording.

## Mask chat windows

Masking is enabled by default. Matched windows remain visible on your display, but Niri replaces them with black rectangles in its screencasts and automatic screen captures.

The desktop app rules cover Beeper, Discord and Vesktop, Teams, Signal, Telegram, WhatsApp, Slack, Mattermost, Element, Zulip, Ferdium, Rambox, and Franz. Teams can also match by window title. For web apps in Chromium-family browsers, title rules cover WhatsApp, Messenger, Google Chat, Slack, and Discord.

Open **Monarch Menu → Settings → Security → Mask Chat Windows**. A check mark means masking is enabled. The choice persists across updates. You can also use:

```bash
monarch toggle chat-privacy status
monarch toggle chat-privacy off
monarch toggle chat-privacy on
```

The toggle controls chat masking only; it does not change automatic DND.

## Automatic Do Not Disturb

While Niri reports at least one active screen share or recording, Monarch turns on Noctalia DND. It restores the previous DND state after the last share ends. If DND was already on before sharing, it stays on afterward. This behavior runs independently of the chat-masking toggle.

To check the watcher:

```bash
systemctl --user status monarch-screencast-dnd.service
```

## Screen recordings

Monarch's [Screenrecord action](/everyday-tasks/capture-and-recording.md) (`monarch screenrecord`) uses the desktop portal by default. Choose a display or window in the sharing dialog. Recordings respect the same **Mask Chat Windows** toggle and automatic DND behavior as screen shares.

On older installations that still use direct capture by default, opt into the portal with:

```bash
MONARCH_SCREENRECORD_USE_PORTAL=true monarch screenrecord
```

The compatibility override `MONARCH_SCREENRECORD_USE_PORTAL=false` selects direct KMS capture. This path bypasses Niri's chat masking and automatic DND. If portal recording cannot start, Monarch reports a failure without automatically switching to direct capture.

## Limits

Masking targets matching **windows**, not an entire workspace. Apps with an unexpected app ID or title may remain visible, so check the captured result before a sensitive share. Browser title rules can hide the whole browser window while a matching chat is open, and [Niri warns](https://niri-wm.github.io/niri/Configuration:-Window-Rules.html#block-out-from) that switching tabs can briefly expose a frame before the title rule catches up.

Niri's interactive screenshot picker still shows matched windows locally and lets you choose to capture them. The automatic DND watcher responds to Niri screencasts, not to taking a screenshot.
