config: add workspace window criteria
This commit is contained in:
parent
5ad6ca4dd3
commit
51e752992f
13 changed files with 88 additions and 3 deletions
|
|
@ -273,6 +273,8 @@ pub struct WindowMatch {
|
|||
pub x_instance_regex: Option<String>,
|
||||
pub x_role: Option<String>,
|
||||
pub x_role_regex: Option<String>,
|
||||
pub workspace: Option<String>,
|
||||
pub workspace_regex: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
|
|
|
|||
|
|
@ -68,7 +68,16 @@ impl Parser for WindowMatchParser<'_> {
|
|||
tag,
|
||||
tag_regex,
|
||||
),
|
||||
(x_class, x_class_regex, x_instance, x_instance_regex, x_role, x_role_regex),
|
||||
(
|
||||
x_class,
|
||||
x_class_regex,
|
||||
x_instance,
|
||||
x_instance_regex,
|
||||
x_role,
|
||||
x_role_regex,
|
||||
workspace,
|
||||
workspace_regex,
|
||||
),
|
||||
) = ext.extract((
|
||||
(
|
||||
opt(str("name")),
|
||||
|
|
@ -100,6 +109,8 @@ impl Parser for WindowMatchParser<'_> {
|
|||
opt(str("x-instance-regex")),
|
||||
opt(str("x-role")),
|
||||
opt(str("x-role-regex")),
|
||||
opt(str("workspace")),
|
||||
opt(str("workspace-regex")),
|
||||
),
|
||||
))?;
|
||||
let mut not = None;
|
||||
|
|
@ -159,6 +170,8 @@ impl Parser for WindowMatchParser<'_> {
|
|||
x_instance_regex: x_instance_regex.despan_into(),
|
||||
x_role: x_role.despan_into(),
|
||||
x_role_regex: x_role_regex.despan_into(),
|
||||
workspace: workspace.despan_into(),
|
||||
workspace_regex: workspace_regex.despan_into(),
|
||||
types,
|
||||
client,
|
||||
})
|
||||
|
|
|
|||
|
|
@ -266,6 +266,8 @@ impl Rule for WindowRule {
|
|||
value!(XInstanceRegex, x_instance_regex);
|
||||
value!(XRole, x_role);
|
||||
value!(XRoleRegex, x_role_regex);
|
||||
value!(WorkspaceName, workspace);
|
||||
value!(WorkspaceNameRegex, workspace_regex);
|
||||
bool!(Floating, floating);
|
||||
bool!(Visible, visible);
|
||||
bool!(Urgent, urgent);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue