o
odinpkg.dev
packages / library / niri_window_count

niri_window_count

latestlibrary

A simple window count indicator for the [Niri](https://github.com/niri-wm/niri) scrollable tiling compositor.

Unlicense · updated 2 months ago

niri_window_count

A simple window count indicator for the niri scrollable tiling compositor.

It tracks how many windows you have open on your current workspace and shows your current position among them.

Build

You'll need the Odin compiler to build this.

odin build .

Usage

It reads from the niri IPC socket and prints the relevant information to stdout. You can use this in your status bar of choice. Here's a sample Waybar widget:

"custom/niri-window-count": {
  "exec": "path/to/niri_window_count",
  "format": "{text}"
}

Formatting

You can customize the output format by passing defines during build:

  • OVERVIEW_FMT: Shown when niri overview is open.
  • SIMPLE_FMT: Shown when there is only one window.
  • FULL_FMT: Shown when there are multiple windows (current/total).

Example:

odin build . -define:SIMPLE_FMT="[ %d ]"