privacy
Apps using the camera, microphone or screen capture right now.
rect {
width = 8,
height = 8,
radius = 4,
background = "#F38BA8",
visible = mantle.privacy:map(function(privacy)
return privacy ~= nil and (#privacy.microphone_users > 0 or #privacy.camera_users > 0)
end),
}
State
mantle.privacy:get() returns PrivacyState, nil before the first push. A field marked ? may be absent.
| Field | Type | Description |
|---|---|---|
camera_users | PrivacyUser[] | One entry per process holding a /dev/videoN open; empty when none is. Only devices present when privacy started are watched. |
microphone_users | PrivacyUser[] | Apps with a running PipeWire audio capture, one per name. Idle streams and sink-monitor captures are absent; a muted microphone still counts. |
screencast_users | PrivacyUser[] | Apps with a running PipeWire screen-capture stream, one per name. wlr-screencopy tools such as wf-recorder and grim never appear. |
PrivacyUser
One app using a camera, microphone or screen capture.
| Field | Type | Description |
|---|---|---|
app_name | string | PipeWire application.name, else /proc/<pid>/comm, else "pid 1234" (or "node 56"); never empty. |
Actions
None: read-only, so any method but get, map and on_change raises.
Backend
| Source | Feeds |
|---|---|
Running Stream/Input/Audio PipeWire nodes | microphone_users |
Running Stream/Output/Video PipeWire nodes | screencast_users |
/proc/*/fd links to a /dev/videoN, rescanned on each inotify open or close of the device | camera_users. A PipeWire Video/Source from the same pid only supplies the name |
The PipeWire half shares audio’s thread. privacy pushes its first /proc
scan as soon as it starts. Without PipeWire the microphone and screencast lists
stay empty and camera_users keeps its first scan: the update loop ends with the PipeWire thread.
Gotchas
| Trap | Fix |
|---|---|
A webcam plugged in after privacy started never shows | The device list is read once at start. Restart the Supervisor |
grim or wf-recorder never shows in screencast_users | wlr-screencopy bypasses PipeWire; only portal screen captures appear |