1
0
Fork 0
forked from wry/wry

config: add WM_CLASS window criteria

This commit is contained in:
Julian Orth 2025-05-03 13:37:23 +02:00
parent 6d3d4dcabb
commit faa0b27ef8
15 changed files with 159 additions and 10 deletions

View file

@ -124,4 +124,6 @@ pub enum WindowCriterionStringField {
Title,
AppId,
Tag,
XClass,
XInstance,
}

View file

@ -1665,6 +1665,10 @@ impl ConfigClient {
WindowCriterion::JustMapped => WindowCriterionIpc::JustMapped,
WindowCriterion::Tag(t) => string!(t, Tag, false),
WindowCriterion::TagRegex(t) => string!(t, Tag, true),
WindowCriterion::XClass(t) => string!(t, XClass, false),
WindowCriterion::XClassRegex(t) => string!(t, XClass, true),
WindowCriterion::XInstance(t) => string!(t, XInstance, false),
WindowCriterion::XInstanceRegex(t) => string!(t, XInstance, true),
};
let res = self.send_with_response(&ClientMessage::CreateWindowMatcher { criterion });
get_response!(

View file

@ -264,6 +264,14 @@ pub enum WindowCriterion<'a> {
Tag(&'a str),
/// Matches the toplevel-tag of the window with a regular expression.
TagRegex(&'a str),
/// Matches the X class of the window verbatim.
XClass(&'a str),
/// Matches the X class of the window with a regular expression.
XClassRegex(&'a str),
/// Matches the X instance of the window verbatim.
XInstance(&'a str),
/// Matches the X instance of the window with a regular expression.
XInstanceRegex(&'a str),
}
impl WindowCriterion<'_> {