config: add comm client criteria
This commit is contained in:
parent
bdabb7bbdd
commit
cc734a135c
12 changed files with 73 additions and 2 deletions
|
|
@ -235,6 +235,8 @@ pub struct ClientMatch {
|
|||
pub uid: Option<i32>,
|
||||
pub pid: Option<i32>,
|
||||
pub is_xwayland: Option<bool>,
|
||||
pub comm: Option<String>,
|
||||
pub comm_regex: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
|
|
|
|||
|
|
@ -49,7 +49,15 @@ impl Parser for ClientMatchParser<'_> {
|
|||
sandbox_app_id,
|
||||
sandbox_app_id_regex,
|
||||
),
|
||||
(sandbox_instance_id, sandbox_instance_id_regex, uid, pid, is_xwayland),
|
||||
(
|
||||
sandbox_instance_id,
|
||||
sandbox_instance_id_regex,
|
||||
uid,
|
||||
pid,
|
||||
is_xwayland,
|
||||
comm,
|
||||
comm_regex,
|
||||
),
|
||||
) = ext.extract((
|
||||
(
|
||||
opt(str("name")),
|
||||
|
|
@ -69,6 +77,8 @@ impl Parser for ClientMatchParser<'_> {
|
|||
opt(s32("uid")),
|
||||
opt(s32("pid")),
|
||||
opt(bol("is-xwayland")),
|
||||
opt(str("comm")),
|
||||
opt(str("comm-regex")),
|
||||
),
|
||||
))?;
|
||||
let mut not = None;
|
||||
|
|
@ -112,6 +122,8 @@ impl Parser for ClientMatchParser<'_> {
|
|||
uid: uid.despan(),
|
||||
pid: pid.despan(),
|
||||
is_xwayland: is_xwayland.despan(),
|
||||
comm: comm.despan_into(),
|
||||
comm_regex: comm_regex.despan_into(),
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -120,6 +120,8 @@ impl Rule for ClientRule {
|
|||
value_ref!(SandboxAppIdRegex, sandbox_app_id_regex);
|
||||
value_ref!(SandboxInstanceId, sandbox_instance_id);
|
||||
value_ref!(SandboxInstanceIdRegex, sandbox_instance_id_regex);
|
||||
value_ref!(Comm, comm);
|
||||
value_ref!(CommRegex, comm_regex);
|
||||
value!(Uid, uid);
|
||||
value!(Pid, pid);
|
||||
bool!(Sandboxed, sandboxed);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue