1
0
Fork 0
forked from wry/wry

config: add pid client criteria

This commit is contained in:
Julian Orth 2025-05-03 12:46:56 +02:00
parent 587ffc7ee5
commit a952e658da
13 changed files with 55 additions and 1 deletions

View file

@ -83,6 +83,7 @@ pub enum ClientCriterionIpc {
},
Sandboxed,
Uid(i32),
Pid(i32),
}
#[derive(Serialize, Deserialize, Clone, Debug, Hash, Eq, PartialEq)]

View file

@ -1543,6 +1543,7 @@ impl ConfigClient {
ClientCriterion::SandboxInstanceIdRegex(t) => string!(t, SandboxInstanceId, true),
ClientCriterion::Sandboxed => ClientCriterionIpc::Sandboxed,
ClientCriterion::Uid(p) => ClientCriterionIpc::Uid(p),
ClientCriterion::Pid(p) => ClientCriterionIpc::Pid(p),
};
let res = self.send_with_response(&ClientMessage::CreateClientMatcher { criterion });
get_response!(

View file

@ -79,6 +79,8 @@ pub enum ClientCriterion<'a> {
Sandboxed,
/// Matches the user ID of the client.
Uid(i32),
/// Matches the process ID of the client.
Pid(i32),
}
impl ClientCriterion<'_> {