1
0
Fork 0
forked from wry/wry

config: add WM_WINDOW_ROLE window criteria

This commit is contained in:
Julian Orth 2025-05-03 14:01:39 +02:00
parent faa0b27ef8
commit 5ad6ca4dd3
14 changed files with 81 additions and 6 deletions

View file

@ -271,6 +271,8 @@ pub struct WindowMatch {
pub x_class_regex: Option<String>,
pub x_instance: Option<String>,
pub x_instance_regex: Option<String>,
pub x_role: Option<String>,
pub x_role_regex: Option<String>,
}
#[derive(Debug, Clone)]

View file

@ -68,7 +68,7 @@ impl Parser for WindowMatchParser<'_> {
tag,
tag_regex,
),
(x_class, x_class_regex, x_instance, x_instance_regex),
(x_class, x_class_regex, x_instance, x_instance_regex, x_role, x_role_regex),
) = ext.extract((
(
opt(str("name")),
@ -98,6 +98,8 @@ impl Parser for WindowMatchParser<'_> {
opt(str("x-class-regex")),
opt(str("x-instance")),
opt(str("x-instance-regex")),
opt(str("x-role")),
opt(str("x-role-regex")),
),
))?;
let mut not = None;
@ -155,6 +157,8 @@ impl Parser for WindowMatchParser<'_> {
x_class_regex: x_class_regex.despan_into(),
x_instance: x_instance.despan_into(),
x_instance_regex: x_instance_regex.despan_into(),
x_role: x_role.despan_into(),
x_role_regex: x_role_regex.despan_into(),
types,
client,
})

View file

@ -264,6 +264,8 @@ impl Rule for WindowRule {
value!(XClassRegex, x_class_regex);
value!(XInstance, x_instance);
value!(XInstanceRegex, x_instance_regex);
value!(XRole, x_role);
value!(XRoleRegex, x_role_regex);
bool!(Floating, floating);
bool!(Visible, visible);
bool!(Urgent, urgent);