Skip to content

Add support for window labels#3414

Open
metlos wants to merge 6 commits intoniri-wm:mainfrom
metlos:window-labels
Open

Add support for window labels#3414
metlos wants to merge 6 commits intoniri-wm:mainfrom
metlos:window-labels

Conversation

@metlos
Copy link

@metlos metlos commented Feb 7, 2026

Hey!

First of all thanks for an utterly awesome piece of software. Niri makes my time using a GUI actually enjoyable :)

Recently, I wanted to mark certain windows such that they would render slightly differently (in my case with a red border, to remind me I should be careful working with them. Looking around the config gave me no idea how to do it but I came across several discussions on the topic (#884, #3120) and possibly others.

This lead me to believe I'm not alone needing this and so I rolled up my sleeves and tried to make my first contribution to your wonderful creation.

This PR makes it possible to programmatically tag or label windows where label is a pair of a key and an optional value. There can be multiple labels present on a window and many windows can have the same label. The PR also adds a match rule for these labels, making it possible to change the behavior/look of the windows based on the presence/absence of labels.

I didn't call the "tags", that the above mentioned discussions mention, tags but rather "labels" (taking inspiration from Kubernetes) because #884 mentioned "tag" conflicts with the name of a wayland protocol.

This PR I think doesn't make #884 fully possible, because it doesn't add "tag" and "remove-tag" (or rather "label" and "remove-label") as window rules but I think something similar could be achieved through scripting. Having "tag" both as a window rule and a match (so that it can be reacted upon) is IMHO dangerous because it could lead to infinite loops if used carelessly.

I think #3120 would be fully possible with this PR.

@metlos metlos force-pushed the window-labels branch 2 times, most recently from 6cf1993 to 4d5166d Compare February 16, 2026 21:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant