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