config: allow matching on client tag
This commit is contained in:
parent
596909cd25
commit
8b19315f50
13 changed files with 76 additions and 8 deletions
|
|
@ -12,7 +12,7 @@ use {
|
|||
clmm_sandboxed::ClmMatchSandboxed,
|
||||
clmm_string::{
|
||||
ClmMatchComm, ClmMatchExe, ClmMatchSandboxAppId, ClmMatchSandboxEngine,
|
||||
ClmMatchSandboxInstanceId,
|
||||
ClmMatchSandboxInstanceId, ClmMatchTag,
|
||||
},
|
||||
clmm_uid::ClmMatchUid,
|
||||
},
|
||||
|
|
@ -61,6 +61,7 @@ pub struct RootMatchers {
|
|||
pid: ClmRootMatcherMap<ClmMatchPid>,
|
||||
comm: ClmRootMatcherMap<ClmMatchComm>,
|
||||
exe: ClmRootMatcherMap<ClmMatchExe>,
|
||||
tag: ClmRootMatcherMap<ClmMatchTag>,
|
||||
}
|
||||
|
||||
impl RootMatchers {
|
||||
|
|
@ -72,6 +73,7 @@ impl RootMatchers {
|
|||
self.pid.clear();
|
||||
self.comm.clear();
|
||||
self.exe.clear();
|
||||
self.tag.clear();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -181,6 +183,7 @@ impl ClMatcherManager {
|
|||
unconditional!(pid);
|
||||
unconditional!(comm);
|
||||
unconditional!(exe);
|
||||
unconditional!(tag);
|
||||
fixed!(sandboxed);
|
||||
fixed!(is_xwayland);
|
||||
self.constant[true].handle(data);
|
||||
|
|
@ -222,6 +225,10 @@ impl ClMatcherManager {
|
|||
pub fn exe(&self, string: CritLiteralOrRegex) -> Rc<ClmUpstreamNode> {
|
||||
self.root(ClmMatchExe::new(string))
|
||||
}
|
||||
|
||||
pub fn tag(&self, string: CritLiteralOrRegex) -> Rc<ClmUpstreamNode> {
|
||||
self.root(ClmMatchTag::new(string))
|
||||
}
|
||||
}
|
||||
|
||||
impl CritTarget for Rc<Client> {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue