1
0
Fork 0
forked from wry/wry

config: add comm client criteria

This commit is contained in:
Julian Orth 2025-05-03 13:03:48 +02:00
parent bdabb7bbdd
commit cc734a135c
12 changed files with 73 additions and 2 deletions

View file

@ -92,4 +92,5 @@ pub enum ClientCriterionStringField {
SandboxEngine,
SandboxAppId,
SandboxInstanceId,
Comm,
}

View file

@ -1545,6 +1545,8 @@ impl ConfigClient {
ClientCriterion::Uid(p) => ClientCriterionIpc::Uid(p),
ClientCriterion::Pid(p) => ClientCriterionIpc::Pid(p),
ClientCriterion::IsXwayland => ClientCriterionIpc::IsXwayland,
ClientCriterion::Comm(t) => string!(t, Comm, false),
ClientCriterion::CommRegex(t) => string!(t, Comm, true),
};
let res = self.send_with_response(&ClientMessage::CreateClientMatcher { criterion });
get_response!(

View file

@ -83,6 +83,10 @@ pub enum ClientCriterion<'a> {
Pid(i32),
/// Matches if the client is Xwayland.
IsXwayland,
/// Matches the `/proc/pid/comm` of the client verbatim.
Comm(&'a str),
/// Matches the `/proc/pid/comm` of the client with a regular expression.
CommRegex(&'a str),
}
impl ClientCriterion<'_> {