config: add app-id window criteria
This commit is contained in:
parent
6ef7655dbd
commit
da64166e82
13 changed files with 102 additions and 24 deletions
|
|
@ -44,27 +44,33 @@ impl Parser for WindowMatchParser<'_> {
|
|||
table: &IndexMap<Spanned<String>, Spanned<Value>>,
|
||||
) -> ParseResult<Self> {
|
||||
let mut ext = Extractor::new(self.0, span, table);
|
||||
let ((
|
||||
name,
|
||||
not_val,
|
||||
all_val,
|
||||
any_val,
|
||||
exactly_val,
|
||||
types_val,
|
||||
client_val,
|
||||
title,
|
||||
title_regex,
|
||||
),) = ext.extract(((
|
||||
opt(str("name")),
|
||||
opt(val("not")),
|
||||
opt(arr("all")),
|
||||
opt(arr("any")),
|
||||
opt(val("exactly")),
|
||||
opt(val("types")),
|
||||
opt(val("client")),
|
||||
opt(str("title")),
|
||||
opt(str("title-regex")),
|
||||
),))?;
|
||||
let (
|
||||
(
|
||||
name,
|
||||
not_val,
|
||||
all_val,
|
||||
any_val,
|
||||
exactly_val,
|
||||
types_val,
|
||||
client_val,
|
||||
title,
|
||||
title_regex,
|
||||
),
|
||||
(app_id, app_id_regex),
|
||||
) = ext.extract((
|
||||
(
|
||||
opt(str("name")),
|
||||
opt(val("not")),
|
||||
opt(arr("all")),
|
||||
opt(arr("any")),
|
||||
opt(val("exactly")),
|
||||
opt(val("types")),
|
||||
opt(val("client")),
|
||||
opt(str("title")),
|
||||
opt(str("title-regex")),
|
||||
),
|
||||
(opt(str("app-id")), opt(str("app-id-regex"))),
|
||||
))?;
|
||||
let mut not = None;
|
||||
if let Some(value) = not_val {
|
||||
not = Some(Box::new(value.parse(&mut WindowMatchParser(self.0))?));
|
||||
|
|
@ -106,6 +112,8 @@ impl Parser for WindowMatchParser<'_> {
|
|||
},
|
||||
title: title.despan_into(),
|
||||
title_regex: title_regex.despan_into(),
|
||||
app_id: app_id.despan_into(),
|
||||
app_id_regex: app_id_regex.despan_into(),
|
||||
types,
|
||||
client,
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue