Star 历史趋势
数据来源: GitHub API · 生成自 Stargazers.cn
README.md

niri-workspaces-rs

A fast, event-driven workspace indicator for Waybar and niri.

niri-workspaces-rs demo

Features

  • Visual bars instead of numbers — each window is rendered as a colored bar.
  • Event-driven daemon mode — keeps a persistent niri socket connection and emits JSON updates only when workspace/window state changes.
  • App-aware coloring — built-in colors for Chrome (red), Firefox, Discord/Vesktop, Spotify, Todoist, Gmail, and terminals.
  • Terminal app detection via /proc — detects jcode, Claude, Codex, and Neovim/Vim running inside terminal windows.
  • Terminal support — works with Alacritty, Kitty, Ghostty, Foot, and Footclient.
  • Focus semantics — uses █ for the focused window, ▌ for the active window on an unfocused workspace, and | for other windows.
  • tmux hinting — uses ¦ for non-focused tmux windows.
  • Cleaner empty workspace handling — unfocused empty workspaces are hidden; a focused empty workspace is shown as a dim ·.
  • Named workspace support — shows the custom workspace name when that workspace is focused; tooltips include only non-empty workspaces.
  • Safer terminal PID detection — skips /proc descendant inference for shared terminal PIDs in cases that can otherwise cause false positives.

Benchmarks

MetricValue
Memory2.5 MB RSS
CPU per update~1.1ms
80 rapid switches~90ms total CPU

Comparison

ApproachCPU per update
Bash script~340ms
Rust + signal~12-14ms
Rust daemon~1.1ms

The daemon is ~10-12x faster than the signal-based approach and ~300x faster than the original bash script.

Installation

cargo build --release
cp target/release/niri-workspaces ~/.config/waybar/

If Waybar is already running, restart Waybar or reload the module so the new binary is picked up.

Waybar Configuration

"custom/workspaces": {
    "exec": "~/.config/waybar/niri-workspaces",
    "return-type": "json",
    "format": "{}"
}

No interval or signal is needed — the daemon outputs JSON whenever relevant niri events occur.

License

MIT

关于 About

Fast Rust waybar module for niri workspace visualization with app-colored window indicators

语言 Languages

Rust100.0%

提交活跃度 Commit Activity

代码提交热力图
过去 52 周的开发活跃度
17
Total Commits
峰值: 6次/周
Less
More

核心贡献者 Contributors