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>,
|
||||
}
|
||||
|
|
@ -28,7 +28,7 @@ use {
|
|||
keyboard::{Keymap, ModifiedKeySym, mods::Modifiers, syms::KeySym},
|
||||
logging::LogLevel,
|
||||
video::GfxApi,
|
||||
window::{ContentType, TileState, WindowType},
|
||||
window::TileState,
|
||||
workspace::WorkspaceDisplayOrder,
|
||||
},
|
||||
std::{
|
||||
|
|
@ -42,9 +42,10 @@ use {
|
|||
};
|
||||
|
||||
pub use jay_config_schema::{
|
||||
AnimationCurveConfig, Animations, ColorManagement, ConfigConnector, ConfigDrmDevice,
|
||||
ConnectorMatch, DrmDeviceMatch, Exec, Float, FocusHistory, InputMatch, Libei, Mode, Output,
|
||||
OutputMatch, RepeatRate, SimpleIm, Status, Tearing, Theme, UiDrag, Vrr, Xwayland,
|
||||
AnimationCurveConfig, Animations, ClientMatch, ColorManagement, ConfigConnector,
|
||||
ConfigDrmDevice, ConnectorMatch, DrmDeviceMatch, Exec, Float, FocusHistory, GenericMatch,
|
||||
InputMatch, Libei, MatchExactly, Mode, Output, OutputMatch, RepeatRate, SimpleIm, Status,
|
||||
Tearing, Theme, UiDrag, Vrr, WindowMatch, Xwayland,
|
||||
};
|
||||
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
|
|
@ -203,21 +204,6 @@ pub enum Action {
|
|||
},
|
||||
}
|
||||
|
||||
#[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(Debug, Clone)]
|
||||
pub struct ClientRule {
|
||||
pub name: Option<String>,
|
||||
|
|
@ -226,25 +212,6 @@ pub struct ClientRule {
|
|||
pub latch: Option<Action>,
|
||||
}
|
||||
|
||||
#[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(Debug, Clone)]
|
||||
pub struct WindowRule {
|
||||
pub name: Option<String>,
|
||||
|
|
@ -255,34 +222,6 @@ pub struct WindowRule {
|
|||
pub initial_tile_state: Option<TileState>,
|
||||
}
|
||||
|
||||
#[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>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct Input {
|
||||
pub tag: Option<String>,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue