1
0
Fork 0
forked from wry/wry

config: add toplevel-tag window criteria

This commit is contained in:
Julian Orth 2025-05-01 17:31:42 +02:00
parent 5f1268cada
commit 6d3d4dcabb
15 changed files with 106 additions and 8 deletions

View file

@ -265,6 +265,8 @@ pub struct WindowMatch {
pub focused: Option<bool>,
pub fullscreen: Option<bool>,
pub just_mapped: Option<bool>,
pub tag: Option<String>,
pub tag_regex: Option<String>,
}
#[derive(Debug, Clone)]

View file

@ -56,7 +56,18 @@ impl Parser for WindowMatchParser<'_> {
title,
title_regex,
),
(app_id, app_id_regex, floating, visible, urgent, focused, fullscreen, just_mapped),
(
app_id,
app_id_regex,
floating,
visible,
urgent,
focused,
fullscreen,
just_mapped,
tag,
tag_regex,
),
) = ext.extract((
(
opt(str("name")),
@ -78,6 +89,8 @@ impl Parser for WindowMatchParser<'_> {
opt(bol("focused")),
opt(bol("fullscreen")),
opt(bol("just-mapped")),
opt(str("tag")),
opt(str("tag-regex")),
),
))?;
let mut not = None;
@ -129,6 +142,8 @@ impl Parser for WindowMatchParser<'_> {
focused: focused.despan(),
fullscreen: fullscreen.despan(),
just_mapped: just_mapped.despan(),
tag: tag.despan_into(),
tag_regex: tag_regex.despan_into(),
types,
client,
})

View file

@ -258,6 +258,8 @@ impl Rule for WindowRule {
value!(TitleRegex, title_regex);
value!(AppId, app_id);
value!(AppIdRegex, app_id_regex);
value!(Tag, tag);
value!(TagRegex, tag_regex);
bool!(Floating, floating);
bool!(Visible, visible);
bool!(Urgent, urgent);