1
0
Fork 0
forked from wry/wry

config: allow matching on client tag

This commit is contained in:
Julian Orth 2026-02-27 20:53:09 +01:00
parent 596909cd25
commit 8b19315f50
13 changed files with 76 additions and 8 deletions

View file

@ -278,6 +278,8 @@ pub struct ClientMatch {
pub comm_regex: Option<String>,
pub exe: Option<String>,
pub exe_regex: Option<String>,
pub tag: Option<String>,
pub tag_regex: Option<String>,
}
#[derive(Debug, Clone)]

View file

@ -54,12 +54,14 @@ impl Parser for ClientMatchParser<'_> {
sandbox_instance_id_regex,
uid,
pid,
is_xwayland,
comm,
comm_regex,
exe,
exe_regex,
tag,
tag_regex,
),
(is_xwayland,),
) = ext.extract((
(
opt(str("name")),
@ -78,12 +80,14 @@ impl Parser for ClientMatchParser<'_> {
opt(str("sandbox-instance-id-regex")),
opt(s32("uid")),
opt(s32("pid")),
opt(bol("is-xwayland")),
opt(str("comm")),
opt(str("comm-regex")),
opt(str("exe")),
opt(str("exe-regex")),
opt(str("tag")),
opt(str("tag-regex")),
),
(opt(bol("is-xwayland")),),
))?;
let mut not = None;
if let Some(value) = not_val {
@ -130,6 +134,8 @@ impl Parser for ClientMatchParser<'_> {
comm_regex: comm_regex.despan_into(),
exe: exe.despan_into(),
exe_regex: exe_regex.despan_into(),
tag: tag.despan_into(),
tag_regex: tag_regex.despan_into(),
})
}
}

View file

@ -127,6 +127,8 @@ impl Rule for ClientRule {
value_ref!(CommRegex, comm_regex);
value_ref!(Exe, exe);
value_ref!(ExeRegex, exe_regex);
value_ref!(Tag, tag);
value_ref!(TagRegex, tag_regex);
value!(Uid, uid);
value!(Pid, pid);
bool!(Sandboxed, sandboxed);