1
0
Fork 0
forked from wry/wry

config: add uid client criteria

This commit is contained in:
Julian Orth 2025-05-03 12:48:44 +02:00
parent 9bf79bf23c
commit 587ffc7ee5
13 changed files with 63 additions and 2 deletions

View file

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

View file

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

View file

@ -77,6 +77,8 @@ pub enum ClientCriterion<'a> {
SandboxInstanceIdRegex(&'a str),
/// Matches if the client is sandboxed.
Sandboxed,
/// Matches the user ID of the client.
Uid(i32),
}
impl ClientCriterion<'_> {