config: move rule match schema into schema crate
This commit is contained in:
parent
f0e7bd31cb
commit
d9261414c2
3 changed files with 70 additions and 66 deletions
|
|
@ -9,6 +9,7 @@ pub mod command;
|
|||
pub mod input;
|
||||
pub mod options;
|
||||
pub mod output;
|
||||
pub mod rules;
|
||||
pub mod theme;
|
||||
|
||||
pub use animations::{AnimationCurveConfig, Animations};
|
||||
|
|
@ -21,4 +22,5 @@ pub use options::{
|
|||
pub use output::{
|
||||
ConfigConnector, ConfigDrmDevice, ConnectorMatch, DrmDeviceMatch, Mode, Output, OutputMatch,
|
||||
};
|
||||
pub use rules::{ClientMatch, GenericMatch, MatchExactly, WindowMatch};
|
||||
pub use theme::Theme;
|
||||
|
|
|
|||
63
jay-config-schema/src/rules.rs
Normal file
63
jay-config-schema/src/rules.rs
Normal file
|
|
@ -0,0 +1,63 @@
|
|||
use jay_config::window::{ContentType, WindowType};
|
||||
|
||||
#[derive(Default, Debug, Clone)]
|
||||
pub struct GenericMatch<Match> {
|
||||
pub name: Option<String>,
|
||||
pub not: Option<Box<Match>>,
|
||||
pub all: Option<Vec<Match>>,
|
||||
pub any: Option<Vec<Match>>,
|
||||
pub exactly: Option<MatchExactly<Match>>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct MatchExactly<Match> {
|
||||
pub num: usize,
|
||||
pub list: Vec<Match>,
|
||||
}
|
||||
|
||||
#[derive(Default, Debug, Clone)]
|
||||
pub struct ClientMatch {
|
||||
pub generic: GenericMatch<Self>,
|
||||
pub sandbox_engine: Option<String>,
|
||||
pub sandbox_engine_regex: Option<String>,
|
||||
pub sandbox_app_id: Option<String>,
|
||||
pub sandbox_app_id_regex: Option<String>,
|
||||
pub sandbox_instance_id: Option<String>,
|
||||
pub sandbox_instance_id_regex: Option<String>,
|
||||
pub sandboxed: Option<bool>,
|
||||
pub uid: Option<i32>,
|
||||
pub pid: Option<i32>,
|
||||
pub is_xwayland: Option<bool>,
|
||||
pub comm: Option<String>,
|
||||
pub comm_regex: Option<String>,
|
||||
pub exe: Option<String>,
|
||||
pub exe_regex: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Default, Debug, Clone)]
|
||||
pub struct WindowMatch {
|
||||
pub generic: GenericMatch<Self>,
|
||||
pub types: Option<WindowType>,
|
||||
pub client: Option<ClientMatch>,
|
||||
pub title: Option<String>,
|
||||
pub title_regex: Option<String>,
|
||||
pub app_id: Option<String>,
|
||||
pub app_id_regex: Option<String>,
|
||||
pub floating: Option<bool>,
|
||||
pub visible: Option<bool>,
|
||||
pub urgent: Option<bool>,
|
||||
pub focused: Option<bool>,
|
||||
pub fullscreen: Option<bool>,
|
||||
pub just_mapped: Option<bool>,
|
||||
pub tag: Option<String>,
|
||||
pub tag_regex: Option<String>,
|
||||
pub x_class: Option<String>,
|
||||
pub x_class_regex: Option<String>,
|
||||
pub x_instance: Option<String>,
|
||||
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>,
|
||||
pub content_types: Option<ContentType>,
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue