docs(schema): ensure all public-facing static config opts have docstrings

This commit is contained in:
LGUG2Z
2025-12-27 12:58:46 -08:00
parent a42e809ade
commit 3d8778a7d6
17 changed files with 1680 additions and 322 deletions

View File

@@ -11,6 +11,7 @@ use serde::Serialize;
#[derive(Debug, Copy, Clone, Serialize, Deserialize, PartialEq)] #[derive(Debug, Copy, Clone, Serialize, Deserialize, PartialEq)]
#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))]
#[serde(untagged)] #[serde(untagged)]
/// Colour representation
pub enum Colour { pub enum Colour {
/// Colour represented as RGB /// Colour represented as RGB
Rgb(Rgb), Rgb(Rgb),
@@ -52,6 +53,7 @@ impl From<Colour> for Color32 {
} }
} }
/// Colour represented as a Hex string
#[derive(Debug, Copy, Clone, Serialize, Deserialize, PartialEq)] #[derive(Debug, Copy, Clone, Serialize, Deserialize, PartialEq)]
pub struct Hex(pub HexColor); pub struct Hex(pub HexColor);
@@ -64,7 +66,8 @@ impl schemars::JsonSchema for Hex {
fn json_schema(_: &mut SchemaGenerator) -> Schema { fn json_schema(_: &mut SchemaGenerator) -> Schema {
schemars::json_schema!({ schemars::json_schema!({
"type": "string", "type": "string",
"format": "color-hex" "format": "color-hex",
"description": "Colour represented as a Hex string"
}) })
} }
} }
@@ -80,6 +83,7 @@ impl From<Colour> for u32 {
#[derive(Debug, Copy, Clone, Serialize, Deserialize, PartialEq)] #[derive(Debug, Copy, Clone, Serialize, Deserialize, PartialEq)]
#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))]
/// Colour represented as RGB
pub struct Rgb { pub struct Rgb {
/// Red /// Red
pub r: u32, pub r: u32,

View File

@@ -12,9 +12,12 @@ use serde::Serialize;
#[derive(Debug, Default, Copy, Clone, Serialize, Deserialize, PartialEq)] #[derive(Debug, Default, Copy, Clone, Serialize, Deserialize, PartialEq)]
#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))]
/// Theme variant
pub enum ThemeVariant { pub enum ThemeVariant {
#[default] #[default]
/// Dark variant
Dark, Dark,
/// Light variant
Light, Light,
} }

View File

@@ -28,18 +28,19 @@ use serde_variant::to_variant_name;
#[derive(Clone, Debug, Serialize, Deserialize, JsonSchema, PartialEq)] #[derive(Clone, Debug, Serialize, Deserialize, JsonSchema, PartialEq)]
#[serde(tag = "type")] #[serde(tag = "type")]
/// Theme
pub enum Theme { pub enum Theme {
/// A theme from catppuccin-egui /// Theme from catppuccin-egui
Catppuccin { Catppuccin {
name: Catppuccin, name: Catppuccin,
accent: Option<CatppuccinValue>, accent: Option<CatppuccinValue>,
}, },
/// A theme from base16-egui-themes /// Theme from base16-egui-themes
Base16 { Base16 {
name: Base16, name: Base16,
accent: Option<Base16Value>, accent: Option<Base16Value>,
}, },
/// A custom base16 palette /// Custom base16 palette
Custom { Custom {
palette: Box<Base16ColourPalette>, palette: Box<Base16ColourPalette>,
accent: Option<Base16Value>, accent: Option<Base16Value>,
@@ -47,22 +48,39 @@ pub enum Theme {
} }
#[derive(Copy, Clone, Debug, Serialize, Deserialize, JsonSchema, PartialEq)] #[derive(Copy, Clone, Debug, Serialize, Deserialize, JsonSchema, PartialEq)]
/// Base16 colour palette: https://github.com/chriskempson/base16
pub struct Base16ColourPalette { pub struct Base16ColourPalette {
/// Base00
pub base_00: Colour, pub base_00: Colour,
/// Base01
pub base_01: Colour, pub base_01: Colour,
/// Base02
pub base_02: Colour, pub base_02: Colour,
/// Base03
pub base_03: Colour, pub base_03: Colour,
/// Base04
pub base_04: Colour, pub base_04: Colour,
/// Base05
pub base_05: Colour, pub base_05: Colour,
/// Base06
pub base_06: Colour, pub base_06: Colour,
/// Base07
pub base_07: Colour, pub base_07: Colour,
/// Base08
pub base_08: Colour, pub base_08: Colour,
/// Base09
pub base_09: Colour, pub base_09: Colour,
/// Base0A
pub base_0a: Colour, pub base_0a: Colour,
/// Base0B
pub base_0b: Colour, pub base_0b: Colour,
/// Base0C
pub base_0c: Colour, pub base_0c: Colour,
/// Base0D
pub base_0d: Colour, pub base_0d: Colour,
/// Base0E
pub base_0e: Colour, pub base_0e: Colour,
/// Base0F
pub base_0f: Colour, pub base_0f: Colour,
} }
@@ -199,28 +217,48 @@ impl Theme {
} }
#[derive(Copy, Clone, Debug, Default, Serialize, Deserialize, JsonSchema, Display, PartialEq)] #[derive(Copy, Clone, Debug, Default, Serialize, Deserialize, JsonSchema, Display, PartialEq)]
/// Base16 value
pub enum Base16Value { pub enum Base16Value {
/// Base00
Base00, Base00,
/// Base01
Base01, Base01,
/// Base02
Base02, Base02,
/// Base03
Base03, Base03,
/// Base04
Base04, Base04,
/// Base05
Base05, Base05,
/// Base06
#[default] #[default]
Base06, Base06,
/// Base07
Base07, Base07,
/// Base08
Base08, Base08,
/// Base09
Base09, Base09,
/// Base0A
Base0A, Base0A,
/// Base0B
Base0B, Base0B,
/// Base0C
Base0C, Base0C,
/// Base0D
Base0D, Base0D,
/// Base0E
Base0E, Base0E,
/// Base0F
Base0F, Base0F,
} }
/// Wrapper around a Base16 colour palette
pub enum Base16Wrapper { pub enum Base16Wrapper {
/// Predefined Base16 colour palette
Base16(Base16), Base16(Base16),
/// Custom Base16 colour palette
Custom(Box<Base16ColourPalette>), Custom(Box<Base16ColourPalette>),
} }
@@ -268,10 +306,15 @@ impl Base16Value {
} }
#[derive(Copy, Clone, Debug, Serialize, Deserialize, JsonSchema, Display, PartialEq)] #[derive(Copy, Clone, Debug, Serialize, Deserialize, JsonSchema, Display, PartialEq)]
/// Catppuccin palette
pub enum Catppuccin { pub enum Catppuccin {
/// Frappe
Frappe, Frappe,
/// Latte
Latte, Latte,
/// Macchiato
Macchiato, Macchiato,
/// Mocha
Mocha, Mocha,
} }
@@ -293,33 +336,60 @@ impl From<Catppuccin> for catppuccin_egui::Theme {
} }
#[derive(Copy, Clone, Debug, Default, Serialize, Deserialize, JsonSchema, Display, PartialEq)] #[derive(Copy, Clone, Debug, Default, Serialize, Deserialize, JsonSchema, Display, PartialEq)]
/// Catppuccin Value
pub enum CatppuccinValue { pub enum CatppuccinValue {
/// Rosewater
Rosewater, Rosewater,
/// Flamingo
Flamingo, Flamingo,
/// Pink
Pink, Pink,
/// Mauve
Mauve, Mauve,
/// Red
Red, Red,
/// Maroon
Maroon, Maroon,
/// Peach
Peach, Peach,
/// Yellow
Yellow, Yellow,
/// Green
Green, Green,
/// Teal
Teal, Teal,
/// Sky
Sky, Sky,
/// Sapphire
Sapphire, Sapphire,
/// Blue
Blue, Blue,
/// Lavender
Lavender, Lavender,
#[default] #[default]
/// Text
Text, Text,
/// Subtext1
Subtext1, Subtext1,
/// Subtext0
Subtext0, Subtext0,
/// Overlay2
Overlay2, Overlay2,
/// Overlay1
Overlay1, Overlay1,
/// Overlay0
Overlay0, Overlay0,
/// Surface2
Surface2, Surface2,
/// Surface1
Surface1, Surface1,
/// Surface0
Surface0, Surface0,
/// Base
Base, Base,
/// Mantle
Mantle, Mantle,
/// Crust
Crust, Crust,
} }

View File

@@ -25,8 +25,33 @@ use serde::Serialize;
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)] #[derive(Clone, Debug, Serialize, Deserialize, PartialEq)]
#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))]
#[serde(untagged)] #[serde(untagged)]
/// Animation configuration
///
/// This can be either global:
/// ```json
/// {
/// "enabled": true,
/// "style": "EaseInSine",
/// "fps": 60,
/// "duration": 250
/// }
/// ```
///
/// Or scoped by an animation kind prefix:
/// ```json
/// {
/// "movement": {
/// "enabled": true,
/// "style": "EaseInSine",
/// "fps": 60,
/// "duration": 250
/// }
/// }
/// ```
pub enum PerAnimationPrefixConfig<T> { pub enum PerAnimationPrefixConfig<T> {
/// Animation configuration prefixed for a specific animation kind
Prefix(HashMap<AnimationPrefix, T>), Prefix(HashMap<AnimationPrefix, T>),
/// Animation configuration for all animation kinds
Global(T), Global(T),
} }

View File

@@ -420,6 +420,7 @@ pub fn apply_ease_func(t: f64, style: AnimationStyle) -> f64 {
AnimationStyle::EaseOutQuad => EaseOutQuad::evaluate(t), AnimationStyle::EaseOutQuad => EaseOutQuad::evaluate(t),
AnimationStyle::EaseInOutQuad => EaseInOutQuad::evaluate(t), AnimationStyle::EaseInOutQuad => EaseInOutQuad::evaluate(t),
AnimationStyle::EaseInCubic => EaseInCubic::evaluate(t), AnimationStyle::EaseInCubic => EaseInCubic::evaluate(t),
AnimationStyle::EaseOutCubic => EaseOutCubic::evaluate(t),
AnimationStyle::EaseInOutCubic => EaseInOutCubic::evaluate(t), AnimationStyle::EaseInOutCubic => EaseInOutCubic::evaluate(t),
AnimationStyle::EaseInQuart => EaseInQuart::evaluate(t), AnimationStyle::EaseInQuart => EaseInQuart::evaluate(t),
AnimationStyle::EaseOutQuart => EaseOutQuart::evaluate(t), AnimationStyle::EaseOutQuart => EaseOutQuart::evaluate(t),

View File

@@ -813,10 +813,26 @@ pub fn hide_border(tracking_hwnd: isize) {
#[derive(Debug, Copy, Clone, Display, Serialize, Deserialize, PartialEq)] #[derive(Debug, Copy, Clone, Display, Serialize, Deserialize, PartialEq)]
#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))]
/// Z Order (https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-setwindowpos)
pub enum ZOrder { pub enum ZOrder {
/// HWND_TOP
///
/// Places the window at the top of the Z order.
Top, Top,
/// HWND_NOTOPMOST
///
/// Places the window above all non-topmost windows (that is, behind all topmost windows).
/// This flag has no effect if the window is already a non-topmost window.
NoTopMost, NoTopMost,
/// HWND_BOTTOM
///
/// Places the window at the bottom of the Z order. If the hWnd parameter identifies a topmost window,
/// the window loses its topmost status and is placed at the bottom of all other windows.
Bottom, Bottom,
/// HWND_TOPMOST
///
/// Places the window above all non-topmost windows.
/// The window maintains its topmost position even when it is deactivated.
TopMost, TopMost,
} }

View File

@@ -8,38 +8,72 @@ use strum::EnumString;
#[derive(Copy, Clone, Debug, Display, EnumString, ValueEnum, PartialEq)] #[derive(Copy, Clone, Debug, Display, EnumString, ValueEnum, PartialEq)]
#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))]
/// Mathematical function which describes the rate at which a value changes
pub enum AnimationStyle { pub enum AnimationStyle {
/// Linear
Linear, Linear,
/// Ease in sine
EaseInSine, EaseInSine,
/// Ease out sine
EaseOutSine, EaseOutSine,
/// Ease in out sine
EaseInOutSine, EaseInOutSine,
/// Ease in quad
EaseInQuad, EaseInQuad,
/// Ease out quad
EaseOutQuad, EaseOutQuad,
/// Ease in out quad
EaseInOutQuad, EaseInOutQuad,
/// Ease in cubic
EaseInCubic, EaseInCubic,
/// Ease out cubic
EaseOutCubic,
/// Ease in out cubic
EaseInOutCubic, EaseInOutCubic,
/// Ease in quart
EaseInQuart, EaseInQuart,
/// Ease out quart
EaseOutQuart, EaseOutQuart,
/// Ease in out quart
EaseInOutQuart, EaseInOutQuart,
/// Ease in quint
EaseInQuint, EaseInQuint,
/// Ease out quint
EaseOutQuint, EaseOutQuint,
/// Ease in out quint
EaseInOutQuint, EaseInOutQuint,
/// Ease in expo
EaseInExpo, EaseInExpo,
/// Ease out expo
EaseOutExpo, EaseOutExpo,
/// Ease in out expo
EaseInOutExpo, EaseInOutExpo,
/// Ease in circ
EaseInCirc, EaseInCirc,
/// Ease out circ
EaseOutCirc, EaseOutCirc,
/// Ease in out circ
EaseInOutCirc, EaseInOutCirc,
/// Ease in back
EaseInBack, EaseInBack,
/// Ease out back
EaseOutBack, EaseOutBack,
/// Ease in out back
EaseInOutBack, EaseInOutBack,
/// Ease in elastic
EaseInElastic, EaseInElastic,
/// Ease out elastic
EaseOutElastic, EaseOutElastic,
/// Ease in out elastic
EaseInOutElastic, EaseInOutElastic,
/// Ease in bounce
EaseInBounce, EaseInBounce,
/// Ease out bounce
EaseOutBounce, EaseOutBounce,
/// Ease in out bounce
EaseInOutBounce, EaseInOutBounce,
#[value(skip)] #[value(skip)]
/// Custom Cubic Bézier function
CubicBezier(f64, f64, f64, f64), CubicBezier(f64, f64, f64, f64),
} }

View File

@@ -704,9 +704,13 @@ impl Arrangement for CustomLayout {
#[derive(Clone, Copy, Debug, Serialize, Deserialize, Display, EnumString, ValueEnum, PartialEq)] #[derive(Clone, Copy, Debug, Serialize, Deserialize, Display, EnumString, ValueEnum, PartialEq)]
#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))]
/// Axis on which to perform an operation
pub enum Axis { pub enum Axis {
/// Horizontal axis
Horizontal, Horizontal,
/// Vertical axis
Vertical, Vertical,
/// Both horizontal and vertical axes
HorizontalAndVertical, HorizontalAndVertical,
} }

View File

@@ -53,41 +53,64 @@ impl ApplicationOptions {
#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] #[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)]
#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))]
#[serde(untagged)] #[serde(untagged)]
/// Rule for matching applications
pub enum MatchingRule { pub enum MatchingRule {
/// Simple matching rule which must evaluate to true
Simple(IdWithIdentifier), Simple(IdWithIdentifier),
/// Composite matching rule where all conditions must evaluate to true
Composite(Vec<IdWithIdentifier>), Composite(Vec<IdWithIdentifier>),
} }
#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] #[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)]
#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))]
/// Rule for assigning applications to a workspace
pub struct WorkspaceMatchingRule { pub struct WorkspaceMatchingRule {
/// Target monitor index
pub monitor_index: usize, pub monitor_index: usize,
/// Target workspace index
pub workspace_index: usize, pub workspace_index: usize,
/// Matching rule for the application
pub matching_rule: MatchingRule, pub matching_rule: MatchingRule,
/// Whether to apply the rule only when the application is initially launched
pub initial_only: bool, pub initial_only: bool,
} }
#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] #[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)]
#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))]
/// Rule for matching applications
pub struct IdWithIdentifier { pub struct IdWithIdentifier {
/// Kind of identifier to target
pub kind: ApplicationIdentifier, pub kind: ApplicationIdentifier,
/// Target identifier
pub id: String, pub id: String,
#[serde(skip_serializing_if = "Option::is_none")] #[serde(skip_serializing_if = "Option::is_none")]
/// Matching strategy to use
pub matching_strategy: Option<MatchingStrategy>, pub matching_strategy: Option<MatchingStrategy>,
} }
#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize, Display)] #[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize, Display)]
#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))]
/// Strategy for matching identifiers
pub enum MatchingStrategy { pub enum MatchingStrategy {
/// Should not be used, only kept for backward compatibility
Legacy, Legacy,
/// Equals
Equals, Equals,
/// Starts With
StartsWith, StartsWith,
/// Ends With
EndsWith, EndsWith,
/// Contains
Contains, Contains,
/// Regex
Regex, Regex,
/// Does not end with
DoesNotEndWith, DoesNotEndWith,
/// Does not start with
DoesNotStartWith, DoesNotStartWith,
/// Does not equal
DoesNotEqual, DoesNotEqual,
/// Does not contain
DoesNotContain, DoesNotContain,
} }

View File

@@ -12,21 +12,109 @@ use super::Sizing;
Clone, Copy, Debug, Serialize, Deserialize, Eq, PartialEq, Display, EnumString, ValueEnum, Clone, Copy, Debug, Serialize, Deserialize, Eq, PartialEq, Display, EnumString, ValueEnum,
)] )]
#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))]
/// A predefined komorebi layout
pub enum DefaultLayout { pub enum DefaultLayout {
/// BSP Layout
///
/// ```
/// +-------+-----+
/// | | |
/// | +--+--+
/// | | |--|
/// +-------+--+--+
/// ```
BSP, BSP,
/// Columns Layout
///
/// ```
/// +--+--+--+--+
/// | | | | |
/// | | | | |
/// | | | | |
/// +--+--+--+--+
/// ```
Columns, Columns,
/// Rows Layout
///
/// ```
/// +-----------+
/// |-----------|
/// |-----------|
/// |-----------|
/// +-----------+
/// ```
Rows, Rows,
/// Vertical Stack Layout
///
/// ```
/// +-------+-----+
/// | | |
/// | +-----+
/// | | |
/// +-------+-----+
/// ```
VerticalStack, VerticalStack,
/// Horizontal Stack Layout
///
/// ```
/// +------+------+
/// | |
/// |------+------+
/// | | |
/// +------+------+
/// ```
HorizontalStack, HorizontalStack,
/// Ultrawide Vertical Stack Layout
///
/// ```
/// +-----+-----------+-----+
/// | | | |
/// | | +-----+
/// | | | |
/// | | +-----+
/// | | | |
/// +-----+-----------+-----+
/// ```
UltrawideVerticalStack, UltrawideVerticalStack,
/// Grid Layout
///
/// ```
/// +-----+-----+ +---+---+---+ +---+---+---+ +---+---+---+
///| | | | | | | | | | | | | | |
///| | | | | | | | | | | | | +---+
///+-----+-----+ | +---+---+ +---+---+---+ +---+---| |
///| | | | | | | | | | | | | +---+
///| | | | | | | | | | | | | | |
///+-----+-----+ +---+---+---+ +---+---+---+ +---+---+---+
/// 4 windows 5 windows 6 windows 7 windows
///```
Grid, Grid,
/// Right Main Vertical Stack Layout
///
/// ```
/// +-----+-------+
/// | | |
/// +-----+ |
/// | | |
/// +-----+-------+
/// ```
RightMainVerticalStack, RightMainVerticalStack,
/// Scrolling Layout
///
/// ```
/// +--+--+--+--+--+--+
/// | | | |
/// | | | |
/// | | | |
/// +--+--+--+--+--+--+
/// ```
Scrolling, Scrolling,
// NOTE: If any new layout is added, please make sure to register the same in `DefaultLayout::cycle` // NOTE: If any new layout is added, please make sure to register the same in `DefaultLayout::cycle`
} }
#[derive(Clone, Copy, Debug, Serialize, Deserialize, Eq, PartialEq)] #[derive(Clone, Copy, Debug, Serialize, Deserialize, Eq, PartialEq)]
#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))]
/// Options for specific layouts
pub struct LayoutOptions { pub struct LayoutOptions {
/// Options related to the Scrolling layout /// Options related to the Scrolling layout
pub scrolling: Option<ScrollingLayoutOptions>, pub scrolling: Option<ScrollingLayoutOptions>,
@@ -36,6 +124,7 @@ pub struct LayoutOptions {
#[derive(Clone, Copy, Debug, Serialize, Deserialize, Eq, PartialEq)] #[derive(Clone, Copy, Debug, Serialize, Deserialize, Eq, PartialEq)]
#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))]
/// Options for the Scrolling layout
pub struct ScrollingLayoutOptions { pub struct ScrollingLayoutOptions {
/// Desired number of visible columns (default: 3) /// Desired number of visible columns (default: 3)
pub columns: usize, pub columns: usize,
@@ -45,6 +134,7 @@ pub struct ScrollingLayoutOptions {
#[derive(Clone, Copy, Debug, Serialize, Deserialize, Eq, PartialEq)] #[derive(Clone, Copy, Debug, Serialize, Deserialize, Eq, PartialEq)]
#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))]
/// Options for the Grid layout
pub struct GridLayoutOptions { pub struct GridLayoutOptions {
/// Maximum number of rows per grid column /// Maximum number of rows per grid column
pub rows: usize, pub rows: usize,

View File

@@ -274,17 +274,24 @@ pub struct SubscribeOptions {
#[derive(Debug, Copy, Clone, Eq, PartialEq, Display, Serialize, Deserialize, ValueEnum)] #[derive(Debug, Copy, Clone, Eq, PartialEq, Display, Serialize, Deserialize, ValueEnum)]
#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))]
/// Stackbar mode
pub enum StackbarMode { pub enum StackbarMode {
/// Always show
Always, Always,
/// Never show
Never, Never,
/// Show on stack
OnStack, OnStack,
} }
#[derive(Debug, Copy, Default, Clone, Eq, PartialEq, Display, Serialize, Deserialize)] #[derive(Debug, Copy, Default, Clone, Eq, PartialEq, Display, Serialize, Deserialize)]
#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))]
/// Starbar label
pub enum StackbarLabel { pub enum StackbarLabel {
#[default] #[default]
/// Process name
Process, Process,
/// Window title
Title, Title,
} }
@@ -292,6 +299,7 @@ pub enum StackbarLabel {
Default, Copy, Clone, Debug, Eq, PartialEq, Display, Serialize, Deserialize, ValueEnum, Default, Copy, Clone, Debug, Eq, PartialEq, Display, Serialize, Deserialize, ValueEnum,
)] )]
#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))]
/// Border style
pub enum BorderStyle { pub enum BorderStyle {
#[default] #[default]
/// Use the system border style /// Use the system border style
@@ -306,6 +314,7 @@ pub enum BorderStyle {
Default, Copy, Clone, Debug, Eq, PartialEq, Display, Serialize, Deserialize, ValueEnum, Default, Copy, Clone, Debug, Eq, PartialEq, Display, Serialize, Deserialize, ValueEnum,
)] )]
#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))]
/// Border style
pub enum BorderImplementation { pub enum BorderImplementation {
#[default] #[default]
/// Use the adjustable komorebi border implementation /// Use the adjustable komorebi border implementation
@@ -329,13 +338,20 @@ pub enum BorderImplementation {
Hash, Hash,
)] )]
#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))]
/// Window kind
pub enum WindowKind { pub enum WindowKind {
/// Single window
Single, Single,
/// Stack container
Stack, Stack,
/// Monocle container
Monocle, Monocle,
#[default] #[default]
/// Unfocused window
Unfocused, Unfocused,
/// Unfocused locked container
UnfocusedLocked, UnfocusedLocked,
/// Floating window
Floating, Floating,
} }
@@ -356,30 +372,37 @@ pub enum StateQuery {
Copy, Clone, Debug, Eq, PartialEq, Serialize, Deserialize, Display, EnumString, ValueEnum, Copy, Clone, Debug, Eq, PartialEq, Serialize, Deserialize, Display, EnumString, ValueEnum,
)] )]
#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))]
/// Application identifier
pub enum ApplicationIdentifier { pub enum ApplicationIdentifier {
/// Executable name
#[serde(alias = "exe")] #[serde(alias = "exe")]
Exe, Exe,
/// Class
#[serde(alias = "class")] #[serde(alias = "class")]
Class, Class,
#[serde(alias = "title")] #[serde(alias = "title")]
/// Window title
Title, Title,
/// Executable path
#[serde(alias = "path")] #[serde(alias = "path")]
Path, Path,
} }
#[derive(Copy, Clone, Debug, PartialEq, Serialize, Deserialize, Display, EnumString, ValueEnum)] #[derive(Copy, Clone, Debug, PartialEq, Serialize, Deserialize, Display, EnumString, ValueEnum)]
#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))]
/// Focus follows mouse implementation
pub enum FocusFollowsMouseImplementation { pub enum FocusFollowsMouseImplementation {
/// A custom FFM implementation (slightly more CPU-intensive) /// Custom FFM implementation (slightly more CPU-intensive)
Komorebi, Komorebi,
/// The native (legacy) Windows FFM implementation /// Native (legacy) Windows FFM implementation
Windows, Windows,
} }
#[derive(Clone, Copy, Debug, Default, Serialize, Deserialize, PartialEq)] #[derive(Clone, Copy, Debug, Default, Serialize, Deserialize, PartialEq)]
#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))]
/// Window management behaviour
pub struct WindowManagementBehaviour { pub struct WindowManagementBehaviour {
/// The current WindowContainerBehaviour to be used /// The current [`WindowContainerBehaviour`] to be used
pub current_behaviour: WindowContainerBehaviour, pub current_behaviour: WindowContainerBehaviour,
/// Override of `current_behaviour` to open new windows as floating windows /// Override of `current_behaviour` to open new windows as floating windows
/// that can be later toggled to tiled, when false it will default to /// that can be later toggled to tiled, when false it will default to
@@ -406,6 +429,7 @@ pub struct WindowManagementBehaviour {
Clone, Copy, Debug, Default, Serialize, Deserialize, Display, EnumString, ValueEnum, PartialEq, Clone, Copy, Debug, Default, Serialize, Deserialize, Display, EnumString, ValueEnum, PartialEq,
)] )]
#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))]
/// Window container behaviour when a new window is opened
pub enum WindowContainerBehaviour { pub enum WindowContainerBehaviour {
/// Create a new container for each new window /// Create a new container for each new window
#[default] #[default]
@@ -418,6 +442,7 @@ pub enum WindowContainerBehaviour {
Clone, Copy, Debug, Default, Serialize, Deserialize, Display, EnumString, ValueEnum, PartialEq, Clone, Copy, Debug, Default, Serialize, Deserialize, Display, EnumString, ValueEnum, PartialEq,
)] )]
#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))]
/// Floating layer behaviour when a new window is opened
pub enum FloatingLayerBehaviour { pub enum FloatingLayerBehaviour {
/// Tile new windows (unless they match a float rule or float override is active) /// Tile new windows (unless they match a float rule or float override is active)
#[default] #[default]
@@ -430,6 +455,7 @@ pub enum FloatingLayerBehaviour {
Clone, Copy, Debug, Default, Serialize, Deserialize, Display, EnumString, ValueEnum, PartialEq, Clone, Copy, Debug, Default, Serialize, Deserialize, Display, EnumString, ValueEnum, PartialEq,
)] )]
#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))]
/// Placement behaviour for floating windows
pub enum Placement { pub enum Placement {
/// Does not change the size or position of the window /// Does not change the size or position of the window
#[default] #[default]
@@ -469,6 +495,7 @@ impl Placement {
Clone, Copy, Debug, Default, PartialEq, Serialize, Deserialize, Display, EnumString, ValueEnum, Clone, Copy, Debug, Default, PartialEq, Serialize, Deserialize, Display, EnumString, ValueEnum,
)] )]
#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))]
/// Move behaviour when the operation works across a monitor boundary
pub enum MoveBehaviour { pub enum MoveBehaviour {
/// Swap the window container with the window container at the edge of the adjacent monitor /// Swap the window container with the window container at the edge of the adjacent monitor
#[default] #[default]
@@ -483,6 +510,7 @@ pub enum MoveBehaviour {
Clone, Copy, Debug, Default, Serialize, Deserialize, Display, EnumString, ValueEnum, PartialEq, Clone, Copy, Debug, Default, Serialize, Deserialize, Display, EnumString, ValueEnum, PartialEq,
)] )]
#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))]
/// Behaviour when an action would cross a monitor boundary
pub enum CrossBoundaryBehaviour { pub enum CrossBoundaryBehaviour {
/// Attempt to perform actions across a workspace boundary /// Attempt to perform actions across a workspace boundary
Workspace, Workspace,
@@ -493,6 +521,7 @@ pub enum CrossBoundaryBehaviour {
#[derive(Copy, Clone, Debug, Serialize, Deserialize, Display, EnumString, ValueEnum, PartialEq)] #[derive(Copy, Clone, Debug, Serialize, Deserialize, Display, EnumString, ValueEnum, PartialEq)]
#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))]
/// Window hiding behaviour
pub enum HidingBehaviour { pub enum HidingBehaviour {
/// END OF LIFE FEATURE: Use the `SW_HIDE` flag to hide windows when switching workspaces (has issues with Electron apps) /// END OF LIFE FEATURE: Use the `SW_HIDE` flag to hide windows when switching workspaces (has issues with Electron apps)
#[deprecated(note = "End of life feature")] #[deprecated(note = "End of life feature")]
@@ -507,18 +536,22 @@ pub enum HidingBehaviour {
Clone, Copy, Debug, Default, PartialEq, Serialize, Deserialize, Display, EnumString, ValueEnum, Clone, Copy, Debug, Default, PartialEq, Serialize, Deserialize, Display, EnumString, ValueEnum,
)] )]
#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))]
/// Operation behaviour for temporarily unmanaged and floating windows
pub enum OperationBehaviour { pub enum OperationBehaviour {
/// Process komorebic commands on temporarily unmanaged/floated windows /// Process commands on temporarily unmanaged/floated windows
#[default] #[default]
Op, Op,
/// Ignore komorebic commands on temporarily unmanaged/floated windows /// Ignore commands on temporarily unmanaged/floated windows
NoOp, NoOp,
} }
#[derive(Clone, Copy, Debug, Serialize, Deserialize, Display, EnumString, ValueEnum)] #[derive(Clone, Copy, Debug, Serialize, Deserialize, Display, EnumString, ValueEnum)]
#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))]
/// Sizing
pub enum Sizing { pub enum Sizing {
/// Increase
Increase, Increase,
/// Decrease
Decrease, Decrease,
} }
@@ -542,9 +575,12 @@ impl Sizing {
Clone, Copy, Debug, Default, Serialize, Deserialize, Display, EnumString, ValueEnum, PartialEq, Clone, Copy, Debug, Default, Serialize, Deserialize, Display, EnumString, ValueEnum, PartialEq,
)] )]
#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))]
/// Window handling behaviour
pub enum WindowHandlingBehaviour { pub enum WindowHandlingBehaviour {
#[default] #[default]
/// Synchronous
Sync, Sync,
/// Asynchronous
Async, Async,
} }

View File

@@ -4,14 +4,15 @@ use windows::Win32::Foundation::RECT;
#[derive(Debug, Default, Clone, Copy, Serialize, Deserialize, Eq, PartialEq)] #[derive(Debug, Default, Clone, Copy, Serialize, Deserialize, Eq, PartialEq)]
#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))]
/// Rectangle dimensions
pub struct Rect { pub struct Rect {
/// The left point in a Win32 Rect /// Left point of the rectangle
pub left: i32, pub left: i32,
/// The top point in a Win32 Rect /// Top point of the rectangle
pub top: i32, pub top: i32,
/// The right point in a Win32 Rect /// Width of the recentangle (from the left point)
pub right: i32, pub right: i32,
/// The bottom point in a Win32 Rect /// Height of the rectangle (from the top point)
pub bottom: i32, pub bottom: i32,
} }

View File

@@ -127,6 +127,7 @@ mod defaults {
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)] #[derive(Clone, Debug, Serialize, Deserialize, PartialEq)]
#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))]
/// Border colours for different container states
pub struct BorderColours { pub struct BorderColours {
/// Border colour when the container contains a single window /// Border colour when the container contains a single window
#[serde(skip_serializing_if = "Option::is_none")] #[serde(skip_serializing_if = "Option::is_none")]
@@ -150,6 +151,7 @@ pub struct BorderColours {
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)] #[derive(Clone, Debug, Serialize, Deserialize, PartialEq)]
#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))]
/// Theme options
pub struct ThemeOptions { pub struct ThemeOptions {
/// Specify Light or Dark variant for theme generation /// Specify Light or Dark variant for theme generation
#[serde(skip_serializing_if = "Option::is_none")] #[serde(skip_serializing_if = "Option::is_none")]
@@ -200,6 +202,7 @@ pub struct ThemeOptions {
#[serde_with::serde_as] #[serde_with::serde_as]
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)] #[derive(Clone, Debug, Serialize, Deserialize, PartialEq)]
#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))]
/// Wallpaper configuration
pub struct Wallpaper { pub struct Wallpaper {
/// Path to the wallpaper image file /// Path to the wallpaper image file
#[serde_as(as = "ResolvedPathBuf")] #[serde_as(as = "ResolvedPathBuf")]
@@ -218,6 +221,7 @@ pub struct Wallpaper {
#[serde_with::serde_as] #[serde_with::serde_as]
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] #[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))]
/// Workspace configuration
pub struct WorkspaceConfig { pub struct WorkspaceConfig {
/// Name /// Name
pub name: String, pub name: String,
@@ -375,6 +379,7 @@ impl From<&Workspace> for WorkspaceConfig {
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] #[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))]
/// Monitor configuration
pub struct MonitorConfig { pub struct MonitorConfig {
/// Workspace configurations /// Workspace configurations
pub workspaces: Vec<WorkspaceConfig>, pub workspaces: Vec<WorkspaceConfig>,
@@ -446,6 +451,7 @@ impl From<&Monitor> for MonitorConfig {
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)] #[derive(Clone, Debug, Serialize, Deserialize, PartialEq)]
#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))]
#[serde(untagged)] #[serde(untagged)]
/// Path(s) to application-specific configuration file(s)
pub enum AppSpecificConfigurationPath { pub enum AppSpecificConfigurationPath {
/// A single `applications.json` file /// A single `applications.json` file
Single(#[serde_as(as = "ResolvedPathBuf")] PathBuf), Single(#[serde_as(as = "ResolvedPathBuf")] PathBuf),
@@ -540,7 +546,7 @@ pub struct StaticConfig {
#[serde(alias = "active_window_border")] #[serde(alias = "active_window_border")]
#[cfg_attr(feature = "schemars", schemars(extend("default" = defaults::BORDER_ENABLED)))] #[cfg_attr(feature = "schemars", schemars(extend("default" = defaults::BORDER_ENABLED)))]
pub border: Option<bool>, pub border: Option<bool>,
/// Window border colours for different container types (has no effect if a theme is defined) /// Window border colours for different container types (has no effect if [`theme`] is defined)
#[serde(skip_serializing_if = "Option::is_none")] #[serde(skip_serializing_if = "Option::is_none")]
#[serde(alias = "active_window_border_colours")] #[serde(alias = "active_window_border_colours")]
pub border_colours: Option<BorderColours>, pub border_colours: Option<BorderColours>,
@@ -624,6 +630,8 @@ pub struct StaticConfig {
#[serde(skip_serializing_if = "Option::is_none")] #[serde(skip_serializing_if = "Option::is_none")]
pub animation: Option<AnimationsConfig>, pub animation: Option<AnimationsConfig>,
/// Theme configuration options /// Theme configuration options
///
/// If a theme is specified, `border_colours` will have no effect
#[serde(skip_serializing_if = "Option::is_none")] #[serde(skip_serializing_if = "Option::is_none")]
pub theme: Option<KomorebiTheme>, pub theme: Option<KomorebiTheme>,
/// Identify applications which are slow to send initial event notifications /// Identify applications which are slow to send initial event notifications
@@ -652,6 +660,7 @@ pub struct StaticConfig {
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)] #[derive(Clone, Debug, Serialize, Deserialize, PartialEq)]
#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))]
/// Animations configuration options
pub struct AnimationsConfig { pub struct AnimationsConfig {
/// Enable or disable animations /// Enable or disable animations
pub enabled: PerAnimationPrefixConfig<bool>, pub enabled: PerAnimationPrefixConfig<bool>,
@@ -670,6 +679,7 @@ pub struct AnimationsConfig {
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)] #[derive(Clone, Debug, Serialize, Deserialize, PartialEq)]
#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))]
#[serde(tag = "palette")] #[serde(tag = "palette")]
/// Komorebi theme
pub enum KomorebiTheme { pub enum KomorebiTheme {
/// A theme from catppuccin-egui /// A theme from catppuccin-egui
Catppuccin { Catppuccin {
@@ -895,6 +905,7 @@ impl StaticConfig {
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)] #[derive(Clone, Debug, Serialize, Deserialize, PartialEq)]
#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))]
/// Stackbar tabs configuration
pub struct TabsConfig { pub struct TabsConfig {
/// Width of a stackbar tab /// Width of a stackbar tab
#[serde(skip_serializing_if = "Option::is_none")] #[serde(skip_serializing_if = "Option::is_none")]
@@ -918,6 +929,7 @@ pub struct TabsConfig {
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)] #[derive(Clone, Debug, Serialize, Deserialize, PartialEq)]
#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))]
/// Stackbar configuration
pub struct StackbarConfig { pub struct StackbarConfig {
/// Stackbar height /// Stackbar height
#[serde(skip_serializing_if = "Option::is_none")] #[serde(skip_serializing_if = "Option::is_none")]

View File

@@ -302,10 +302,11 @@ impl RenderDispatcher for TransparencyRenderDispatcher {
#[derive(Copy, Clone, Debug, Display, EnumString, Serialize, Deserialize, PartialEq)] #[derive(Copy, Clone, Debug, Display, EnumString, Serialize, Deserialize, PartialEq)]
#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))]
#[serde(untagged)] #[serde(untagged)]
/// Aspect ratio for temporarily floating windows
pub enum AspectRatio { pub enum AspectRatio {
/// A predefined aspect ratio /// Predefined aspect ratio
Predefined(PredefinedAspectRatio), Predefined(PredefinedAspectRatio),
/// A custom W:H aspect ratio /// Custom W:H aspect ratio
Custom(i32, i32), Custom(i32, i32),
} }
@@ -317,6 +318,7 @@ impl Default for AspectRatio {
#[derive(Copy, Clone, Debug, Default, Display, EnumString, Serialize, Deserialize, PartialEq)] #[derive(Copy, Clone, Debug, Default, Display, EnumString, Serialize, Deserialize, PartialEq)]
#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))] #[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))]
/// Predefined aspect ratio
pub enum PredefinedAspectRatio { pub enum PredefinedAspectRatio {
/// 21:9 /// 21:9
Ultrawide, Ultrawide,

View File

@@ -7,12 +7,28 @@
}, },
"$defs": { "$defs": {
"ApplicationIdentifier": { "ApplicationIdentifier": {
"type": "string", "description": "Application identifier",
"enum": [ "oneOf": [
"Exe", {
"Class", "description": "Executable name",
"Title", "type": "string",
"Path" "const": "Exe"
},
{
"description": "Class",
"type": "string",
"const": "Class"
},
{
"description": "Window title",
"type": "string",
"const": "Title"
},
{
"description": "Executable path",
"type": "string",
"const": "Path"
}
] ]
}, },
"AscApplicationRules": { "AscApplicationRules": {
@@ -112,15 +128,19 @@
] ]
}, },
"IdWithIdentifier": { "IdWithIdentifier": {
"description": "Rule for matching applications",
"type": "object", "type": "object",
"properties": { "properties": {
"id": { "id": {
"description": "Target identifier",
"type": "string" "type": "string"
}, },
"kind": { "kind": {
"description": "Kind of identifier to target",
"$ref": "#/$defs/ApplicationIdentifier" "$ref": "#/$defs/ApplicationIdentifier"
}, },
"matching_strategy": { "matching_strategy": {
"description": "Matching strategy to use",
"anyOf": [ "anyOf": [
{ {
"$ref": "#/$defs/MatchingStrategy" "$ref": "#/$defs/MatchingStrategy"
@@ -137,11 +157,14 @@
] ]
}, },
"MatchingRule": { "MatchingRule": {
"description": "Rule for matching applications",
"anyOf": [ "anyOf": [
{ {
"description": "Simple matching rule which must evaluate to true",
"$ref": "#/$defs/IdWithIdentifier" "$ref": "#/$defs/IdWithIdentifier"
}, },
{ {
"description": "Composite matching rule where all conditions must evaluate to true",
"type": "array", "type": "array",
"items": { "items": {
"$ref": "#/$defs/IdWithIdentifier" "$ref": "#/$defs/IdWithIdentifier"
@@ -150,18 +173,58 @@
] ]
}, },
"MatchingStrategy": { "MatchingStrategy": {
"type": "string", "description": "Strategy for matching identifiers",
"enum": [ "oneOf": [
"Legacy", {
"Equals", "description": "Should not be used, only kept for backward compatibility",
"StartsWith", "type": "string",
"EndsWith", "const": "Legacy"
"Contains", },
"Regex", {
"DoesNotEndWith", "description": "Equals",
"DoesNotStartWith", "type": "string",
"DoesNotEqual", "const": "Equals"
"DoesNotContain" },
{
"description": "Starts With",
"type": "string",
"const": "StartsWith"
},
{
"description": "Ends With",
"type": "string",
"const": "EndsWith"
},
{
"description": "Contains",
"type": "string",
"const": "Contains"
},
{
"description": "Regex",
"type": "string",
"const": "Regex"
},
{
"description": "Does not end with",
"type": "string",
"const": "DoesNotEndWith"
},
{
"description": "Does not start with",
"type": "string",
"const": "DoesNotStartWith"
},
{
"description": "Does not equal",
"type": "string",
"const": "DoesNotEqual"
},
{
"description": "Does not contain",
"type": "string",
"const": "DoesNotContain"
}
] ]
} }
} }

View File

@@ -187,43 +187,165 @@
] ]
}, },
"AnimationStyle": { "AnimationStyle": {
"description": "Mathematical function which describes the rate at which a value changes",
"oneOf": [ "oneOf": [
{ {
"description": "Linear",
"type": "string", "type": "string",
"enum": [ "const": "Linear"
"Linear",
"EaseInSine",
"EaseOutSine",
"EaseInOutSine",
"EaseInQuad",
"EaseOutQuad",
"EaseInOutQuad",
"EaseInCubic",
"EaseInOutCubic",
"EaseInQuart",
"EaseOutQuart",
"EaseInOutQuart",
"EaseInQuint",
"EaseOutQuint",
"EaseInOutQuint",
"EaseInExpo",
"EaseOutExpo",
"EaseInOutExpo",
"EaseInCirc",
"EaseOutCirc",
"EaseInOutCirc",
"EaseInBack",
"EaseOutBack",
"EaseInOutBack",
"EaseInElastic",
"EaseOutElastic",
"EaseInOutElastic",
"EaseInBounce",
"EaseOutBounce",
"EaseInOutBounce"
]
}, },
{ {
"description": "Ease in sine",
"type": "string",
"const": "EaseInSine"
},
{
"description": "Ease out sine",
"type": "string",
"const": "EaseOutSine"
},
{
"description": "Ease in out sine",
"type": "string",
"const": "EaseInOutSine"
},
{
"description": "Ease in quad",
"type": "string",
"const": "EaseInQuad"
},
{
"description": "Ease out quad",
"type": "string",
"const": "EaseOutQuad"
},
{
"description": "Ease in out quad",
"type": "string",
"const": "EaseInOutQuad"
},
{
"description": "Ease in cubic",
"type": "string",
"const": "EaseInCubic"
},
{
"description": "Ease out cubic",
"type": "string",
"const": "EaseOutCubic"
},
{
"description": "Ease in out cubic",
"type": "string",
"const": "EaseInOutCubic"
},
{
"description": "Ease in quart",
"type": "string",
"const": "EaseInQuart"
},
{
"description": "Ease out quart",
"type": "string",
"const": "EaseOutQuart"
},
{
"description": "Ease in out quart",
"type": "string",
"const": "EaseInOutQuart"
},
{
"description": "Ease in quint",
"type": "string",
"const": "EaseInQuint"
},
{
"description": "Ease out quint",
"type": "string",
"const": "EaseOutQuint"
},
{
"description": "Ease in out quint",
"type": "string",
"const": "EaseInOutQuint"
},
{
"description": "Ease in expo",
"type": "string",
"const": "EaseInExpo"
},
{
"description": "Ease out expo",
"type": "string",
"const": "EaseOutExpo"
},
{
"description": "Ease in out expo",
"type": "string",
"const": "EaseInOutExpo"
},
{
"description": "Ease in circ",
"type": "string",
"const": "EaseInCirc"
},
{
"description": "Ease out circ",
"type": "string",
"const": "EaseOutCirc"
},
{
"description": "Ease in out circ",
"type": "string",
"const": "EaseInOutCirc"
},
{
"description": "Ease in back",
"type": "string",
"const": "EaseInBack"
},
{
"description": "Ease out back",
"type": "string",
"const": "EaseOutBack"
},
{
"description": "Ease in out back",
"type": "string",
"const": "EaseInOutBack"
},
{
"description": "Ease in elastic",
"type": "string",
"const": "EaseInElastic"
},
{
"description": "Ease out elastic",
"type": "string",
"const": "EaseOutElastic"
},
{
"description": "Ease in out elastic",
"type": "string",
"const": "EaseInOutElastic"
},
{
"description": "Ease in bounce",
"type": "string",
"const": "EaseInBounce"
},
{
"description": "Ease out bounce",
"type": "string",
"const": "EaseOutBounce"
},
{
"description": "Ease in out bounce",
"type": "string",
"const": "EaseInOutBounce"
},
{
"description": "Custom Cubic Bézier function",
"type": "object", "type": "object",
"properties": { "properties": {
"CubicBezier": { "CubicBezier": {
@@ -307,12 +429,28 @@
] ]
}, },
"ApplicationIdentifier": { "ApplicationIdentifier": {
"type": "string", "description": "Application identifier",
"enum": [ "oneOf": [
"Exe", {
"Class", "description": "Executable name",
"Title", "type": "string",
"Path" "const": "Exe"
},
{
"description": "Class",
"type": "string",
"const": "Class"
},
{
"description": "Window title",
"type": "string",
"const": "Title"
},
{
"description": "Executable path",
"type": "string",
"const": "Path"
}
] ]
}, },
"ApplicationsConfig": { "ApplicationsConfig": {
@@ -381,11 +519,23 @@
] ]
}, },
"Axis": { "Axis": {
"type": "string", "description": "Axis on which to perform an operation",
"enum": [ "oneOf": [
"Horizontal", {
"Vertical", "description": "Horizontal axis",
"HorizontalAndVertical" "type": "string",
"const": "Horizontal"
},
{
"description": "Vertical axis",
"type": "string",
"const": "Vertical"
},
{
"description": "Both horizontal and vertical axes",
"type": "string",
"const": "HorizontalAndVertical"
}
] ]
}, },
"Base16": { "Base16": {
@@ -663,54 +813,71 @@
] ]
}, },
"Base16ColourPalette": { "Base16ColourPalette": {
"description": "Base16 colour palette: https://github.com/chriskempson/base16",
"type": "object", "type": "object",
"properties": { "properties": {
"base_00": { "base_00": {
"description": "Base00",
"$ref": "#/$defs/Colour" "$ref": "#/$defs/Colour"
}, },
"base_01": { "base_01": {
"description": "Base01",
"$ref": "#/$defs/Colour" "$ref": "#/$defs/Colour"
}, },
"base_02": { "base_02": {
"description": "Base02",
"$ref": "#/$defs/Colour" "$ref": "#/$defs/Colour"
}, },
"base_03": { "base_03": {
"description": "Base03",
"$ref": "#/$defs/Colour" "$ref": "#/$defs/Colour"
}, },
"base_04": { "base_04": {
"description": "Base04",
"$ref": "#/$defs/Colour" "$ref": "#/$defs/Colour"
}, },
"base_05": { "base_05": {
"description": "Base05",
"$ref": "#/$defs/Colour" "$ref": "#/$defs/Colour"
}, },
"base_06": { "base_06": {
"description": "Base06",
"$ref": "#/$defs/Colour" "$ref": "#/$defs/Colour"
}, },
"base_07": { "base_07": {
"description": "Base07",
"$ref": "#/$defs/Colour" "$ref": "#/$defs/Colour"
}, },
"base_08": { "base_08": {
"description": "Base08",
"$ref": "#/$defs/Colour" "$ref": "#/$defs/Colour"
}, },
"base_09": { "base_09": {
"description": "Base09",
"$ref": "#/$defs/Colour" "$ref": "#/$defs/Colour"
}, },
"base_0a": { "base_0a": {
"description": "Base0A",
"$ref": "#/$defs/Colour" "$ref": "#/$defs/Colour"
}, },
"base_0b": { "base_0b": {
"description": "Base0B",
"$ref": "#/$defs/Colour" "$ref": "#/$defs/Colour"
}, },
"base_0c": { "base_0c": {
"description": "Base0C",
"$ref": "#/$defs/Colour" "$ref": "#/$defs/Colour"
}, },
"base_0d": { "base_0d": {
"description": "Base0D",
"$ref": "#/$defs/Colour" "$ref": "#/$defs/Colour"
}, },
"base_0e": { "base_0e": {
"description": "Base0E",
"$ref": "#/$defs/Colour" "$ref": "#/$defs/Colour"
}, },
"base_0f": { "base_0f": {
"description": "Base0F",
"$ref": "#/$defs/Colour" "$ref": "#/$defs/Colour"
} }
}, },
@@ -734,24 +901,88 @@
] ]
}, },
"Base16Value": { "Base16Value": {
"type": "string", "description": "Base16 value",
"enum": [ "oneOf": [
"Base00", {
"Base01", "description": "Base00",
"Base02", "type": "string",
"Base03", "const": "Base00"
"Base04", },
"Base05", {
"Base06", "description": "Base01",
"Base07", "type": "string",
"Base08", "const": "Base01"
"Base09", },
"Base0A", {
"Base0B", "description": "Base02",
"Base0C", "type": "string",
"Base0D", "const": "Base02"
"Base0E", },
"Base0F" {
"description": "Base03",
"type": "string",
"const": "Base03"
},
{
"description": "Base04",
"type": "string",
"const": "Base04"
},
{
"description": "Base05",
"type": "string",
"const": "Base05"
},
{
"description": "Base06",
"type": "string",
"const": "Base06"
},
{
"description": "Base07",
"type": "string",
"const": "Base07"
},
{
"description": "Base08",
"type": "string",
"const": "Base08"
},
{
"description": "Base09",
"type": "string",
"const": "Base09"
},
{
"description": "Base0A",
"type": "string",
"const": "Base0A"
},
{
"description": "Base0B",
"type": "string",
"const": "Base0B"
},
{
"description": "Base0C",
"type": "string",
"const": "Base0C"
},
{
"description": "Base0D",
"type": "string",
"const": "Base0D"
},
{
"description": "Base0E",
"type": "string",
"const": "Base0E"
},
{
"description": "Base0F",
"type": "string",
"const": "Base0F"
}
] ]
}, },
"BatteryConfig": { "BatteryConfig": {
@@ -805,6 +1036,7 @@
] ]
}, },
"BorderImplementation": { "BorderImplementation": {
"description": "Border style",
"oneOf": [ "oneOf": [
{ {
"description": "Use the adjustable komorebi border implementation", "description": "Use the adjustable komorebi border implementation",
@@ -819,6 +1051,7 @@
] ]
}, },
"BorderStyle": { "BorderStyle": {
"description": "Border style",
"oneOf": [ "oneOf": [
{ {
"description": "Use the system border style", "description": "Use the system border style",
@@ -838,46 +1071,167 @@
] ]
}, },
"Catppuccin": { "Catppuccin": {
"type": "string", "description": "Catppuccin palette",
"enum": [ "oneOf": [
"Frappe", {
"Latte", "description": "Frappe",
"Macchiato", "type": "string",
"Mocha" "const": "Frappe"
},
{
"description": "Latte",
"type": "string",
"const": "Latte"
},
{
"description": "Macchiato",
"type": "string",
"const": "Macchiato"
},
{
"description": "Mocha",
"type": "string",
"const": "Mocha"
}
] ]
}, },
"CatppuccinValue": { "CatppuccinValue": {
"type": "string", "description": "Catppuccin Value",
"enum": [ "oneOf": [
"Rosewater", {
"Flamingo", "description": "Rosewater",
"Pink", "type": "string",
"Mauve", "const": "Rosewater"
"Red", },
"Maroon", {
"Peach", "description": "Flamingo",
"Yellow", "type": "string",
"Green", "const": "Flamingo"
"Teal", },
"Sky", {
"Sapphire", "description": "Pink",
"Blue", "type": "string",
"Lavender", "const": "Pink"
"Text", },
"Subtext1", {
"Subtext0", "description": "Mauve",
"Overlay2", "type": "string",
"Overlay1", "const": "Mauve"
"Overlay0", },
"Surface2", {
"Surface1", "description": "Red",
"Surface0", "type": "string",
"Base", "const": "Red"
"Mantle", },
"Crust" {
"description": "Maroon",
"type": "string",
"const": "Maroon"
},
{
"description": "Peach",
"type": "string",
"const": "Peach"
},
{
"description": "Yellow",
"type": "string",
"const": "Yellow"
},
{
"description": "Green",
"type": "string",
"const": "Green"
},
{
"description": "Teal",
"type": "string",
"const": "Teal"
},
{
"description": "Sky",
"type": "string",
"const": "Sky"
},
{
"description": "Sapphire",
"type": "string",
"const": "Sapphire"
},
{
"description": "Blue",
"type": "string",
"const": "Blue"
},
{
"description": "Lavender",
"type": "string",
"const": "Lavender"
},
{
"description": "Text",
"type": "string",
"const": "Text"
},
{
"description": "Subtext1",
"type": "string",
"const": "Subtext1"
},
{
"description": "Subtext0",
"type": "string",
"const": "Subtext0"
},
{
"description": "Overlay2",
"type": "string",
"const": "Overlay2"
},
{
"description": "Overlay1",
"type": "string",
"const": "Overlay1"
},
{
"description": "Overlay0",
"type": "string",
"const": "Overlay0"
},
{
"description": "Surface2",
"type": "string",
"const": "Surface2"
},
{
"description": "Surface1",
"type": "string",
"const": "Surface1"
},
{
"description": "Surface0",
"type": "string",
"const": "Surface0"
},
{
"description": "Base",
"type": "string",
"const": "Base"
},
{
"description": "Mantle",
"type": "string",
"const": "Mantle"
},
{
"description": "Crust",
"type": "string",
"const": "Crust"
}
] ]
}, },
"Colour": { "Colour": {
"description": "Colour representation",
"anyOf": [ "anyOf": [
{ {
"description": "Colour represented as RGB", "description": "Colour represented as RGB",
@@ -1047,17 +1401,53 @@
] ]
}, },
"DefaultLayout": { "DefaultLayout": {
"type": "string", "description": "A predefined komorebi layout",
"enum": [ "oneOf": [
"BSP", {
"Columns", "description": "BSP Layout\n\n```\n+-------+-----+\n| | |\n| +--+--+\n| | |--|\n+-------+--+--+\n```",
"Rows", "type": "string",
"VerticalStack", "const": "BSP"
"HorizontalStack", },
"UltrawideVerticalStack", {
"Grid", "description": "Columns Layout\n\n```\n+--+--+--+--+\n| | | | |\n| | | | |\n| | | | |\n+--+--+--+--+\n```",
"RightMainVerticalStack", "type": "string",
"Scrolling" "const": "Columns"
},
{
"description": "Rows Layout\n\n```\n+-----------+\n|-----------|\n|-----------|\n|-----------|\n+-----------+\n```",
"type": "string",
"const": "Rows"
},
{
"description": "Vertical Stack Layout\n\n```\n+-------+-----+\n| | |\n| +-----+\n| | |\n+-------+-----+\n```",
"type": "string",
"const": "VerticalStack"
},
{
"description": "Horizontal Stack Layout\n\n```\n+------+------+\n| |\n|------+------+\n| | |\n+------+------+\n```",
"type": "string",
"const": "HorizontalStack"
},
{
"description": "Ultrawide Vertical Stack Layout\n\n```\n+-----+-----------+-----+\n| | | |\n| | +-----+\n| | | |\n| | +-----+\n| | | |\n+-----+-----------+-----+\n```",
"type": "string",
"const": "UltrawideVerticalStack"
},
{
"description": "Grid Layout\n\n```\n+-----+-----+ +---+---+---+ +---+---+---+ +---+---+---+\n| | | | | | | | | | | | | | |\n| | | | | | | | | | | | | +---+\n+-----+-----+ | +---+---+ +---+---+---+ +---+---| |\n| | | | | | | | | | | | | +---+\n| | | | | | | | | | | | | | |\n+-----+-----+ +---+---+---+ +---+---+---+ +---+---+---+\n 4 windows 5 windows 6 windows 7 windows\n```",
"type": "string",
"const": "Grid"
},
{
"description": "Right Main Vertical Stack Layout\n\n```\n+-----+-------+\n| | |\n+-----+ |\n| | |\n+-----+-------+\n```",
"type": "string",
"const": "RightMainVerticalStack"
},
{
"description": "Scrolling Layout\n\n```\n+--+--+--+--+--+--+\n| | | |\n| | | |\n| | | |\n+--+--+--+--+--+--+\n```",
"type": "string",
"const": "Scrolling"
}
] ]
}, },
"DisplayFormat": { "DisplayFormat": {
@@ -1090,14 +1480,15 @@
] ]
}, },
"FocusFollowsMouseImplementation": { "FocusFollowsMouseImplementation": {
"description": "Focus follows mouse implementation",
"oneOf": [ "oneOf": [
{ {
"description": "A custom FFM implementation (slightly more CPU-intensive)", "description": "Custom FFM implementation (slightly more CPU-intensive)",
"type": "string", "type": "string",
"const": "Komorebi" "const": "Komorebi"
}, },
{ {
"description": "The native (legacy) Windows FFM implementation", "description": "Native (legacy) Windows FFM implementation",
"type": "string", "type": "string",
"const": "Windows" "const": "Windows"
} }
@@ -1300,10 +1691,12 @@
] ]
}, },
"Hex": { "Hex": {
"description": "Colour represented as a Hex string",
"type": "string", "type": "string",
"format": "color-hex" "format": "color-hex"
}, },
"HidingBehaviour": { "HidingBehaviour": {
"description": "Window hiding behaviour",
"oneOf": [ "oneOf": [
{ {
"description": "END OF LIFE FEATURE: Use the `SW_HIDE` flag to hide windows when switching workspaces (has issues with Electron apps)", "description": "END OF LIFE FEATURE: Use the `SW_HIDE` flag to hide windows when switching workspaces (has issues with Electron apps)",
@@ -1764,6 +2157,7 @@
] ]
}, },
"KomorebiTheme": { "KomorebiTheme": {
"description": "Komorebi theme",
"oneOf": [ "oneOf": [
{ {
"description": "A theme from catppuccin-egui", "description": "A theme from catppuccin-egui",
@@ -2492,6 +2886,7 @@
] ]
}, },
"MoveBehaviour": { "MoveBehaviour": {
"description": "Move behaviour when the operation works across a monitor boundary",
"oneOf": [ "oneOf": [
{ {
"description": "Swap the window container with the window container at the edge of the adjacent monitor", "description": "Swap the window container with the window container at the edge of the adjacent monitor",
@@ -2622,14 +3017,15 @@
} }
}, },
"OperationBehaviour": { "OperationBehaviour": {
"description": "Operation behaviour for temporarily unmanaged and floating windows",
"oneOf": [ "oneOf": [
{ {
"description": "Process komorebic commands on temporarily unmanaged/floated windows", "description": "Process commands on temporarily unmanaged/floated windows",
"type": "string", "type": "string",
"const": "Op" "const": "Op"
}, },
{ {
"description": "Ignore komorebic commands on temporarily unmanaged/floated windows", "description": "Ignore commands on temporarily unmanaged/floated windows",
"type": "string", "type": "string",
"const": "NoOp" "const": "NoOp"
} }
@@ -2694,25 +3090,26 @@
} }
}, },
"Rect": { "Rect": {
"description": "Rectangle dimensions",
"type": "object", "type": "object",
"properties": { "properties": {
"bottom": { "bottom": {
"description": "The bottom point in a Win32 Rect", "description": "Height of the rectangle (from the top point)",
"type": "integer", "type": "integer",
"format": "int32" "format": "int32"
}, },
"left": { "left": {
"description": "The left point in a Win32 Rect", "description": "Left point of the rectangle",
"type": "integer", "type": "integer",
"format": "int32" "format": "int32"
}, },
"right": { "right": {
"description": "The right point in a Win32 Rect", "description": "Width of the recentangle (from the left point)",
"type": "integer", "type": "integer",
"format": "int32" "format": "int32"
}, },
"top": { "top": {
"description": "The top point in a Win32 Rect", "description": "Top point of the rectangle",
"type": "integer", "type": "integer",
"format": "int32" "format": "int32"
} }
@@ -2725,6 +3122,7 @@
] ]
}, },
"Rgb": { "Rgb": {
"description": "Colour represented as RGB",
"type": "object", "type": "object",
"properties": { "properties": {
"b": { "b": {
@@ -2772,10 +3170,18 @@
] ]
}, },
"Sizing": { "Sizing": {
"type": "string", "description": "Sizing",
"enum": [ "oneOf": [
"Increase", {
"Decrease" "description": "Increase",
"type": "string",
"const": "Increase"
},
{
"description": "Decrease",
"type": "string",
"const": "Decrease"
}
] ]
}, },
"SocketMessage": { "SocketMessage": {
@@ -6303,18 +6709,38 @@
] ]
}, },
"StackbarLabel": { "StackbarLabel": {
"type": "string", "description": "Starbar label",
"enum": [ "oneOf": [
"Process", {
"Title" "description": "Process name",
"type": "string",
"const": "Process"
},
{
"description": "Window title",
"type": "string",
"const": "Title"
}
] ]
}, },
"StackbarMode": { "StackbarMode": {
"type": "string", "description": "Stackbar mode",
"enum": [ "oneOf": [
"Always", {
"Never", "description": "Always show",
"OnStack" "type": "string",
"const": "Always"
},
{
"description": "Never show",
"type": "string",
"const": "Never"
},
{
"description": "Show on stack",
"type": "string",
"const": "OnStack"
}
] ]
}, },
"StateQuery": { "StateQuery": {
@@ -6682,14 +7108,38 @@
] ]
}, },
"WindowKind": { "WindowKind": {
"type": "string", "description": "Window kind",
"enum": [ "oneOf": [
"Single", {
"Stack", "description": "Single window",
"Monocle", "type": "string",
"Unfocused", "const": "Single"
"UnfocusedLocked", },
"Floating" {
"description": "Stack container",
"type": "string",
"const": "Stack"
},
{
"description": "Monocle container",
"type": "string",
"const": "Monocle"
},
{
"description": "Unfocused window",
"type": "string",
"const": "Unfocused"
},
{
"description": "Unfocused locked container",
"type": "string",
"const": "UnfocusedLocked"
},
{
"description": "Floating window",
"type": "string",
"const": "Floating"
}
] ]
}, },
"WorkspacesDisplayFormat": { "WorkspacesDisplayFormat": {

File diff suppressed because it is too large Load Diff