From 36b5a831fc6d40cd36e791bd625d02c4c15cbb51 Mon Sep 17 00:00:00 2001 From: kossLAN Date: Fri, 29 May 2026 17:10:00 -0400 Subject: [PATCH] config: move simple command schema into schema crate --- jay-config-schema/src/action.rs | 56 ++++++++++++++++++++++++++++++++ jay-config-schema/src/lib.rs | 2 ++ toml-config/src/config.rs | 57 ++------------------------------- 3 files changed, 60 insertions(+), 55 deletions(-) create mode 100644 jay-config-schema/src/action.rs diff --git a/jay-config-schema/src/action.rs b/jay-config-schema/src/action.rs new file mode 100644 index 00000000..647308b0 --- /dev/null +++ b/jay-config-schema/src/action.rs @@ -0,0 +1,56 @@ +use jay_config::{ + Direction, + input::{LayerDirection, Timeline}, +}; + +#[derive(Debug, Copy, Clone)] +pub enum SimpleCommand { + Close, + DisablePointerConstraint, + Focus(Direction), + FocusParent, + Move(Direction), + None, + Quit, + ReloadConfigToml, + ToggleFloating, + SetFloating(bool), + ToggleFullscreen, + SetFullscreen(bool), + Forward(bool), + EnableWindowManagement(bool), + SetFloatAboveFullscreen(bool), + ToggleFloatAboveFullscreen, + SetFloatPinned(bool), + ToggleFloatPinned, + KillClient, + ShowBar(bool), + ToggleBar, + ShowTitles(bool), + ToggleTitles, + FloatTitles(bool), + ToggleFloatTitles, + FocusHistory(Timeline), + FocusLayerRel(LayerDirection), + FocusTiles, + ToggleFocusFloatTiled, + CreateMark, + JumpToMark, + PopMode(bool), + EnableSimpleIm(bool), + ToggleSimpleImEnabled, + ReloadSimpleIm, + EnableUnicodeInput, + WarpMouseToFocus, + ToggleTab, + MakeGroupH, + MakeGroupV, + MakeGroupTab, + ChangeGroupOpposite, + Equalize, + EqualizeRecursive, + MoveTabLeft, + MoveTabRight, + SetAutotile(bool), + ToggleAutotile, +} diff --git a/jay-config-schema/src/lib.rs b/jay-config-schema/src/lib.rs index ed590361..74821107 100644 --- a/jay-config-schema/src/lib.rs +++ b/jay-config-schema/src/lib.rs @@ -4,6 +4,7 @@ //! policy, and docs metadata that need to be consumed by TOML parsing, //! generated config documentation, and compositor-side application code. +pub mod action; pub mod animations; pub mod command; pub mod input; @@ -13,6 +14,7 @@ pub mod output; pub mod rules; pub mod theme; +pub use action::SimpleCommand; pub use animations::{AnimationCurveConfig, Animations}; pub use command::{Exec, Status}; pub use input::InputMatch; diff --git a/toml-config/src/config.rs b/toml-config/src/config.rs index 7bbbb62b..32d26a3a 100644 --- a/toml-config/src/config.rs +++ b/toml-config/src/config.rs @@ -22,8 +22,7 @@ use { jay_config::{ Direction, Workspace, input::{ - FallbackOutputMode, LayerDirection, SwitchEvent, Timeline, acceleration::AccelProfile, - clickmethod::ClickMethod, + FallbackOutputMode, SwitchEvent, acceleration::AccelProfile, clickmethod::ClickMethod, }, keyboard::{ModifiedKeySym, mods::Modifiers, syms::KeySym}, logging::LogLevel, @@ -45,61 +44,9 @@ pub use jay_config_schema::{ AnimationCurveConfig, Animations, ClientMatch, ColorManagement, ConfigConnector, ConfigDrmDevice, ConfigKeymap, ConnectorMatch, DrmDeviceMatch, Exec, Float, FocusHistory, GenericMatch, InputMatch, Libei, MatchExactly, Mode, Output, OutputMatch, RepeatRate, - SimpleIm, Status, Tearing, Theme, UiDrag, Vrr, WindowMatch, Xwayland, + SimpleCommand, SimpleIm, Status, Tearing, Theme, UiDrag, Vrr, WindowMatch, Xwayland, }; -#[derive(Debug, Copy, Clone)] -pub enum SimpleCommand { - Close, - DisablePointerConstraint, - Focus(Direction), - FocusParent, - Move(Direction), - None, - Quit, - ReloadConfigToml, - ToggleFloating, - SetFloating(bool), - ToggleFullscreen, - SetFullscreen(bool), - Forward(bool), - EnableWindowManagement(bool), - SetFloatAboveFullscreen(bool), - ToggleFloatAboveFullscreen, - SetFloatPinned(bool), - ToggleFloatPinned, - KillClient, - ShowBar(bool), - ToggleBar, - ShowTitles(bool), - ToggleTitles, - FloatTitles(bool), - ToggleFloatTitles, - FocusHistory(Timeline), - FocusLayerRel(LayerDirection), - FocusTiles, - ToggleFocusFloatTiled, - CreateMark, - JumpToMark, - PopMode(bool), - EnableSimpleIm(bool), - ToggleSimpleImEnabled, - ReloadSimpleIm, - EnableUnicodeInput, - WarpMouseToFocus, - ToggleTab, - MakeGroupH, - MakeGroupV, - MakeGroupTab, - ChangeGroupOpposite, - Equalize, - EqualizeRecursive, - MoveTabLeft, - MoveTabRight, - SetAutotile(bool), - ToggleAutotile, -} - #[derive(Debug, Clone)] #[expect(clippy::enum_variant_names)] pub enum Action {