Open
Conversation
6cf1993 to
4d5166d
Compare
4d5166d to
8d4e12b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.