No description
  • Rust 75.4%
  • Nix 24.6%
Find a file
2026-03-18 13:33:58 +00:00
resources chore: added readme,license 2026-03-18 13:33:58 +00:00
src feat: refactor + optimisations 2026-01-23 17:43:59 +00:00
.gitignore feat: initial commit 2025-12-13 19:01:27 +02:00
Cargo.lock feat(config): added config file 2025-12-18 04:28:20 +02:00
Cargo.toml feat(config): added config file 2025-12-18 04:28:20 +02:00
flake.lock feat: initial commit 2025-12-13 19:01:27 +02:00
flake.nix feat: also act as a server that prints output to a file 2025-12-13 19:55:00 +02:00
LICENSE chore: added readme,license 2026-03-18 13:33:58 +00:00
README.md chore: added readme,license 2026-03-18 13:33:58 +00:00

Waybar Privacy Monitor

A lightweight privacy monitor for Waybar that tracks the status of your microphone, camera, and screen recording/sharing.


Camera and Mic Active
Active indicators for Microphone (orange) and Camera (green)
Screen Recording Active
Active indicator for Screen Recording (pink)


Warning

This is only tested on my system with the following:

  • Display Server: Wayland (Hyprland)
  • Audio Server: PipeWire (with pipewire-pulse)
  • Status Bar: Waybar

It relies on specific tools like pactl and pw-link and scanning /proc file descriptors. It may not work out-of-the-box on other configurations (e.g., X11, pure PulseAudio, etc.).

How it Works

The monitor runs in the background and:

  1. Watches PulseAudio (via pactl) for Microphone usage.
  2. Scans active processes for open /dev/video* file descriptors to detect webcam usage.
  3. Checks PipeWire links (via pw-link) for screen sharing active streams.

When a change is detected, it writes a JSON status to /tmp/waybar-privacy-monitor-status.json and signals Waybar to update.

Installation & Usage

1. Run the Monitor

You need to ensure the binary is running in the background of your session.

If you are using NixOS with Hyprland, you can add it to your flake inputs and run it from your exec-once list.

# flake.nix:
{
  inputs.waybar-privacy-monitor.url = "github:akotro/waybar-privacy-monitor";
}
# hyprland.nix:
exec-once = [
  "${inputs.waybar-privacy-monitor.packages.${pkgs.system}.default}/bin/bar-privacy-monitor"
];

Or manually run it:

./bar-privacy-monitor &

2. Configure Waybar

Add the following module configuration to your waybar config (usually ~/.config/waybar/config).

"custom/privacy": {
  "exec": "cat /tmp/waybar-privacy-monitor-status.json",
  "interval": "once",
  "return-type": "json",
  "format": "{}",
  "tooltip": true,
  "signal": 8
}

Ensure you add "custom/privacy" to your modules list (e.g., "modules-right").

You can optionally add some css as well in style.css (usually ~/.config/waybar/style.css).

#custom-privacy {
  margin: 0 4px;
}

Configuration

The tool uses a configuration file located at ~/.config/waybar-privacy-monitor/config.toml. If it doesn't exist, it will be created with default values.

status_file = "/tmp/waybar-privacy-monitor-status.json"
waybar_signal = 8

[mic]
icon = ""
color = "#ff6a00"

[cam]
icon = ""
color = "#42be65"

[screen]
icon = ""
color = "#ee5396"