privacy

package
v0.3.24 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 11, 2026 License: MIT Imports: 16 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package privacy follows what records the user: the applications capturing a microphone, from the audio server's record streams, and the processes holding a camera open, from inotify on the video devices and one /proc scan per open or close.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CameraUser

type CameraUser struct {
	PID    int
	Name   string
	Device string
}

CameraUser is one process holding a camera open.

func ScanCameras

func ScanCameras(procRoot string, uid int, devices []string) ([]CameraUser, error)

ScanCameras lists the processes of uid under procRoot (/proc) with one of devices open, by reading their file descriptor links; the processes it may not read are someone else's and are skipped.

type Cameras

type Cameras struct {
	// contains filtered or unexported fields
}

Cameras follows which processes hold a camera open. Nothing runs between events: inotify reports opens and closes of the video nodes and nodes appearing in the device directory, and each report rescans /proc once.

func WatchCameras

func WatchCameras(devDir, procRoot string, uid int) (*Cameras, error)

WatchCameras starts following the cameras of devDir (/dev) held by uid's processes under procRoot (/proc).

func (*Cameras) Close

func (c *Cameras) Close() error

Close stops following the cameras.

func (*Cameras) Subscribe

func (c *Cameras) Subscribe() (<-chan struct{}, func())

Subscribe ticks when Users changes.

func (*Cameras) Users

func (c *Cameras) Users() []CameraUser

Users are the processes holding a camera now.

type MicUser

type MicUser struct {
	Stream pulse.StreamKey
	// Name is the application's name, else its binary, else the stream's.
	Name   string
	Icon   string
	Muted  bool
	Source string
}

MicUser is one application recording a microphone.

func MicUsers

func MicUsers(streams []pulse.AudioStream, sources []pulse.InputDevice, self uint32) []MicUser

MicUsers are the record streams that capture a microphone: running, attached to a source that is not a sink's monitor, not a level meter's peak stream, and not opened by the process self (lys-shell's own recorder and visualizer).

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL