From 6dbcfdf1f3df6428790892277f883c6399a33ad8 Mon Sep 17 00:00:00 2001 From: LGUG2Z Date: Fri, 30 Oct 2026 22:53:34 -0700 Subject: [PATCH] refactor(komorebic-core): fifteen subcommands whose help differed join Messages with one help text border-colour, monocle-focus-behaviour, toggle-monocle-focus-behaviour, toggle-window-container-behaviour, toggle-workspace-window-container-behaviour, unmanaged-window-operation-behaviour, scrolling-layout-columns, scrolling-layout-full-width, expel, retile, center-focus, consume, toggle-column-stack, eager-focus and promote-focus had the same arguments, flags and messages in the three trees and only their help text differed. They move into Messages (and out of WindowsCommands, MacosCommands and the KDE komorebic with their arms and argument structs) with ONE text each: the Windows text, except for eager-focus and promote-focus, where the wording two of the trees shared wins ('executable', 'largest window container'). The page diff against the pre-move output is docs only (reviewed, kept in the progress log): KDE says colour and behaviour instead of color and behavior in six pages; Windows eager-focus and promote-focus change a phrase; macOS loses the longer descriptions it had for center-focus, consume, expel, retile and toggle-column-stack and the three of its scrolling pages that differ from the Windows wording get the Windows text. Nothing that changes behaviour (flags, defaults, possible values, aliases) differs. The longer macOS descriptions make claims about the other layouts and about retile that were not checked for the Windows and KDE daemons, so the shorter text was kept; restoring them is a one-revision change to messages.rs. data-directory, disable-autostart, log (platform facts: paths, shortcuts, komorebi.exe), enable-autostart, start, stop and pan stay in the platform enums. Verified: oracle compare: only the pages above differ (windows 2, macos 7, kde 6 of 187/158/166); native cargo test -p komorebic-core 34 passed; KDE cargo test -p komorebic --locked 80 passed; macOS fake-CC cargo check --locked 0 errors; Windows clippy --workspace --locked --all-targets -D warnings clean. --- crates/komorebic-core/src/args.rs | 33 +++++++ crates/komorebic-core/src/messages.rs | 70 ++++++++++++++ crates/komorebic-core/src/platform/macos.rs | 92 ------------------ crates/komorebic-core/src/platform/windows.rs | 74 -------------- komorebi-for-kde/komorebic/src/main.rs | 96 ------------------- komorebi-for-mac/komorebic/src/main.rs | 52 ---------- komorebic/src/main.rs | 52 ---------- 7 files changed, 103 insertions(+), 366 deletions(-) diff --git a/crates/komorebic-core/src/args.rs b/crates/komorebic-core/src/args.rs index b11db7c9..76a397e5 100644 --- a/crates/komorebic-core/src/args.rs +++ b/crates/komorebic-core/src/args.rs @@ -29,6 +29,8 @@ use komorebi_protocol::types::HidingBehaviour; use komorebi_protocol::types::MoveBehaviour; use komorebi_protocol::types::OperationBehaviour; use komorebi_protocol::types::StateQuery; +use komorebi_protocol::types::WindowKind; +use std::num::NonZeroUsize; use std::path::PathBuf; /// `enable` or `disable`, the way most of the subcommands that turn something on or off say it. @@ -412,6 +414,37 @@ pub struct AnimationStyle { pub animation_type: Option, } +#[derive(Args, Clone, Debug)] +pub struct BorderColour { + #[clap(value_enum, short, long, default_value = "single")] + pub window_kind: WindowKind, + /// Red + pub r: u32, + /// Green + pub g: u32, + /// Blue + pub b: u32, +} + +#[derive(Args, Clone, Debug)] +pub struct MonocleFocusBehaviour { + /// Desired monocle focus behaviour + #[clap(value_enum)] + pub behaviour: komorebi_protocol::types::MonocleFocusBehaviour, +} + +#[derive(Args, Clone, Debug)] +pub struct ScrollingLayoutColumns { + /// Desired number of visible columns + pub count: NonZeroUsize, +} + +#[derive(Args, Clone, Debug)] +pub struct EagerFocus { + /// Case-sensitive exe identifier + pub exe: String, +} + #[cfg(test)] mod tests { use super::*; diff --git a/crates/komorebic-core/src/messages.rs b/crates/komorebic-core/src/messages.rs index 128c3943..df753105 100644 --- a/crates/komorebic-core/src/messages.rs +++ b/crates/komorebic-core/src/messages.rs @@ -14,6 +14,7 @@ use komorebi_layouts::OperationDirection; use komorebi_layouts::Rect; use komorebi_protocol::message::SocketMessage; use komorebi_protocol::types::MoveBehaviour; +use komorebi_protocol::types::OperationBehaviour; use komorebi_protocol::types::StateQuery; #[derive(Subcommand, Clone, Debug)] @@ -363,6 +364,48 @@ pub enum Messages { /// Set the ease function for movement animations #[clap(arg_required_else_help = true)] AnimationStyle(AnimationStyle), + /// Set the colour for a window border kind + #[clap(arg_required_else_help = true)] + #[clap(alias = "active-window-border-colour")] + BorderColour(BorderColour), + /// Set the behaviour when focusing in a direction while a monocle container is active + #[clap(arg_required_else_help = true)] + MonocleFocusBehaviour(MonocleFocusBehaviour), + /// Toggle the behaviour when focusing in a direction while a monocle container is active + ToggleMonocleFocusBehaviour, + /// Toggle the behaviour for new windows (stacking or dynamic tiling) + ToggleWindowContainerBehaviour, + /// Toggle the behaviour for new windows (stacking or dynamic tiling) for currently focused + /// workspace. If there was no behaviour set for the workspace previously it takes the opposite + /// of the global value. + ToggleWorkspaceWindowContainerBehaviour, + /// Set the operation behaviour when the focused window is not managed + #[clap(arg_required_else_help = true)] + UnmanagedWindowOperationBehaviour(OneEnum), + /// Set the number of visible columns for the Scrolling layout on the focused workspace + #[clap(arg_required_else_help = true)] + ScrollingLayoutColumns(ScrollingLayoutColumns), + /// Make the focused column of the Scrolling layout as wide as the screen, or put it back to + /// the width that it had + ScrollingLayoutFullWidth, + /// Take the focused window out of its column in the Scrolling layout and put it in a column + /// of its own on the right + Expel, + /// Force the retiling of all managed windows + Retile, + /// Scroll the Scrolling layout so that the focused column is in the middle of the screen, once + CenterFocus, + /// Take the neighbouring window on one side into the focused column of the Scrolling layout + #[clap(arg_required_else_help = true)] + Consume(OneEnum), + /// Stack the windows of the focused column of the Scrolling layout, or spread the focused + /// stack out into a column with a window in each slot + ToggleColumnStack, + /// Focus the first managed window matching the given executable + #[clap(arg_required_else_help = true)] + EagerFocus(EagerFocus), + /// Promote the user focus to the largest window container + PromoteFocus, } impl Messages { @@ -662,6 +705,33 @@ impl From for SocketMessage { Messages::AnimationStyle(args) => { SocketMessage::AnimationStyle(args.style, args.animation_type) } + Messages::BorderColour(args) => { + SocketMessage::BorderColour(args.window_kind, args.r, args.g, args.b) + } + Messages::MonocleFocusBehaviour(args) => { + SocketMessage::MonocleFocusBehaviour(args.behaviour) + } + Messages::ToggleMonocleFocusBehaviour => SocketMessage::ToggleMonocleFocusBehaviour, + Messages::ToggleWindowContainerBehaviour => { + SocketMessage::ToggleWindowContainerBehaviour + } + Messages::ToggleWorkspaceWindowContainerBehaviour => { + SocketMessage::ToggleWorkspaceWindowContainerBehaviour + } + Messages::UnmanagedWindowOperationBehaviour(args) => { + SocketMessage::UnmanagedWindowOperationBehaviour(args.value) + } + Messages::ScrollingLayoutColumns(args) => { + SocketMessage::ScrollingLayoutColumns(args.count) + } + Messages::ScrollingLayoutFullWidth => SocketMessage::ScrollingLayoutFullWidth, + Messages::Expel => SocketMessage::Expel, + Messages::Retile => SocketMessage::Retile, + Messages::CenterFocus => SocketMessage::CenterFocus, + Messages::Consume(args) => SocketMessage::Consume(args.value), + Messages::ToggleColumnStack => SocketMessage::ToggleColumnStack, + Messages::EagerFocus(args) => SocketMessage::EagerFocus(args.exe), + Messages::PromoteFocus => SocketMessage::PromoteFocus, } } } diff --git a/crates/komorebic-core/src/platform/macos.rs b/crates/komorebic-core/src/platform/macos.rs index 858d0d04..b6951768 100644 --- a/crates/komorebic-core/src/platform/macos.rs +++ b/crates/komorebic-core/src/platform/macos.rs @@ -1,21 +1,11 @@ //! The subcommands of komorebic for Macos that are not a message to the daemon in every `komorebic`. -use crate::args::*; use clap::Parser; use clap::Subcommand; use komorebi_layouts::*; use komorebi_protocol::pathext::replace_env_in_path; -use komorebi_protocol::types::*; -use std::num::NonZeroUsize; use std::path::PathBuf; -#[derive(Parser)] -pub struct MonocleFocusBehaviour { - /// Desired monocle focus behaviour - #[clap(value_enum)] - pub behaviour: komorebi_protocol::types::MonocleFocusBehaviour, -} - #[derive(Parser)] #[allow(clippy::struct_excessive_bools)] pub struct Start { @@ -52,18 +42,6 @@ pub struct EnableAutostart { pub bar: bool, } -#[derive(Parser)] -pub struct EagerFocus { - /// Case-sensitive exe identifier - pub exe: String, -} - -#[derive(Parser)] -pub struct ScrollingLayoutColumns { - /// Number of columns that fit across the screen - pub count: NonZeroUsize, -} - #[derive(Parser)] pub struct Pan { /// The way that the view goes @@ -100,18 +78,6 @@ pub struct LayoutRatios { pub rows: Option>, } -#[derive(Parser)] -pub struct BorderColour { - #[clap(value_enum, short, long, default_value = "single")] - pub window_kind: WindowKind, - /// Red - pub r: u32, - /// Green - pub g: u32, - /// Blue - pub b: u32, -} - #[derive(Parser)] pub struct Docgen { /// Output directory for generated documentation files @@ -189,41 +155,9 @@ pub enum MacosCommands { Log, // /// Forcibly focus the window at the cursor with a left mouse click // ForceFocus, - /// Focus the first managed window matching the given executable - #[clap(arg_required_else_help = true)] - EagerFocus(EagerFocus), // /// Set the invisible border dimensions around each window // #[clap(arg_required_else_help = true)] // InvisibleBorders(InvisibleBorders), - /// Set how many columns fit across the Scrolling layout on the focused workspace - #[clap(arg_required_else_help = true)] - ScrollingLayoutColumns(ScrollingLayoutColumns), - /// Make the focused column of the Scrolling layout as wide as the screen, or put it back - ScrollingLayoutFullWidth, - /// Scroll the Scrolling layout so that the focused column is in the middle of the screen, once - /// - /// Only the Scrolling layout scrolls, so this does nothing in the other layouts. - CenterFocus, - /// Take the window on one side into the focused column - /// - /// Left takes the last window of the column on the left to the top of the focused column, and - /// right takes the first window of the column on the right to the bottom of it. Up and down do - /// nothing. Only the Scrolling layout has columns of several windows, so this does nothing in - /// the other layouts. - #[clap(arg_required_else_help = true)] - Consume(OneEnum), - /// Take the focused window out of its column and into a column of its own - /// - /// Only the Scrolling layout has columns of several windows, so this does nothing in the other - /// layouts. - Expel, - /// Stack the windows of the focused column, or spread a stack out into a column - /// - /// A column of several windows becomes one stack of all of them, which takes the height of the - /// column and shows one window at a time, and the usual stack commands work on it. A stack - /// becomes a column with a window in each slot, in the order of its tabs. Only the Scrolling - /// layout has columns of several windows, so this does nothing in the other layouts. - ToggleColumnStack, /// Move the view of the Scrolling layout a column to the left or the right, or with the /// fingers on a touchpad /// @@ -246,14 +180,6 @@ pub enum MacosCommands { // #[clap(hide = true)] // #[clap(arg_required_else_help = true)] // LoadCustomLayout(LoadCustomLayout), - /// Promote the user focus to the largest window container - PromoteFocus, - /// Force the retiling of all managed windows - /// - /// Every column of a workspace in the Scrolling layout goes back to the width that - /// scrolling-layout-columns gives, and every window in a column of several goes back to an - /// equal share of its height. - Retile, // /// Set the monitor index preference for a monitor identified using its size // #[clap(arg_required_else_help = true)] // MonitorIndexPreference(MonitorIndexPreference), @@ -273,12 +199,6 @@ pub enum MacosCommands { // #[clap(hide = true)] // #[clap(arg_required_else_help = true)] // NamedWorkspaceCustomLayoutRule(NamedWorkspaceCustomLayoutRule), - /// Toggle the behaviour for new windows (stacking or dynamic tiling) - ToggleWindowContainerBehaviour, - /// Toggle the behaviour for new windows (stacking or dynamic tiling) for currently focused - /// workspace. If there was no behaviour set for the workspace previously it takes the opposite - /// of the global value. - ToggleWorkspaceWindowContainerBehaviour, // /// Toggle native maximization for the focused window // ToggleMaximize, // /// Restore all hidden windows (debugging command) @@ -297,14 +217,6 @@ pub enum MacosCommands { // /// Set the window behaviour when switching workspaces / cycling stacks // #[clap(arg_required_else_help = true)] // WindowHidingBehaviour(WindowHidingBehaviour), - /// Set the behaviour when focusing in a direction while a monocle container is active - #[clap(arg_required_else_help = true)] - MonocleFocusBehaviour(MonocleFocusBehaviour), - /// Toggle the behaviour when focusing in a direction while a monocle container is active - ToggleMonocleFocusBehaviour, - /// Set the operation behaviour when the focused window is not managed - #[clap(arg_required_else_help = true)] - UnmanagedWindowOperationBehaviour(OneEnum), // /// Identify an application that sends EVENT_OBJECT_NAMECHANGE on launch // #[clap(arg_required_else_help = true)] // IdentifyObjectNameChangeApplication(IdentifyObjectNameChangeApplication), @@ -323,10 +235,6 @@ pub enum MacosCommands { // #[clap(hide = true)] // #[clap(alias = "identify-border-overflow")] // IdentifyBorderOverflowApplication(IdentifyBorderOverflowApplication), - /// Set the colour for a window border kind - #[clap(arg_required_else_help = true)] - #[clap(alias = "active-window-border-colour")] - BorderColour(BorderColour), // /// Set the border style // #[clap(arg_required_else_help = true)] // BorderStyle(BorderStyle), diff --git a/crates/komorebic-core/src/platform/windows.rs b/crates/komorebic-core/src/platform/windows.rs index ec978d78..ea90001a 100644 --- a/crates/komorebic-core/src/platform/windows.rs +++ b/crates/komorebic-core/src/platform/windows.rs @@ -6,7 +6,6 @@ use clap::Subcommand; use komorebi_layouts::*; use komorebi_protocol::pathext::replace_env_in_path; use komorebi_protocol::types::*; -use std::num::NonZeroUsize; use std::path::PathBuf; #[derive(Parser)] @@ -113,18 +112,6 @@ pub struct TransparencyAlpha { pub alpha: u8, } -#[derive(Parser)] -pub struct BorderColour { - #[clap(value_enum, short, long, default_value = "single")] - pub window_kind: WindowKind, - /// Red - pub r: u32, - /// Green - pub g: u32, - /// Blue - pub b: u32, -} - #[derive(Parser)] pub struct BorderStyle { /// Desired border style @@ -132,13 +119,6 @@ pub struct BorderStyle { pub style: komorebi_protocol::types::BorderStyle, } -#[derive(Parser)] -pub struct MonocleFocusBehaviour { - /// Desired monocle focus behaviour - #[clap(value_enum)] - pub behaviour: komorebi_protocol::types::MonocleFocusBehaviour, -} - #[derive(Parser)] pub struct BorderImplementation { /// Desired border implementation @@ -324,18 +304,6 @@ pub struct Check { pub komorebi_config: Option, } -#[derive(Parser)] -pub struct EagerFocus { - /// Case-sensitive exe identifier - pub exe: String, -} - -#[derive(Parser)] -pub struct ScrollingLayoutColumns { - /// Desired number of visible columns - pub count: NonZeroUsize, -} - #[derive(Parser)] pub struct Pan { /// The way that the view goes @@ -431,29 +399,9 @@ pub enum WindowsCommands { Log, /// Forcibly focus the window at the cursor with a left mouse click ForceFocus, - /// Focus the first managed window matching the given exe - #[clap(arg_required_else_help = true)] - EagerFocus(EagerFocus), /// Set the invisible border dimensions around each window #[clap(arg_required_else_help = true)] InvisibleBorders(InvisibleBorders), - /// Set the number of visible columns for the Scrolling layout on the focused workspace - #[clap(arg_required_else_help = true)] - ScrollingLayoutColumns(ScrollingLayoutColumns), - /// Make the focused column of the Scrolling layout as wide as the screen, or put it back to - /// the width that it had - ScrollingLayoutFullWidth, - /// Scroll the Scrolling layout so that the focused column is in the middle of the screen, once - CenterFocus, - /// Take the neighbouring window on one side into the focused column of the Scrolling layout - #[clap(arg_required_else_help = true)] - Consume(OneEnum), - /// Take the focused window out of its column in the Scrolling layout and put it in a column - /// of its own on the right - Expel, - /// Stack the windows of the focused column of the Scrolling layout, or spread the focused - /// stack out into a column with a window in each slot - ToggleColumnStack, /// Move the view of the Scrolling layout a column to the left or the right, or with the /// fingers on a touchpad, which does nothing in any other layout #[clap(arg_required_else_help = true)] @@ -464,10 +412,6 @@ pub enum WindowsCommands { #[clap(hide = true)] #[clap(arg_required_else_help = true)] LoadCustomLayout(LoadCustomLayout), - /// Promote the user focus to the top of the tree - PromoteFocus, - /// Force the retiling of all managed windows - Retile, /// Set the monitor index preference for a monitor identified using its size #[clap(arg_required_else_help = true)] MonitorIndexPreference(MonitorIndexPreference), @@ -487,12 +431,6 @@ pub enum WindowsCommands { #[clap(hide = true)] #[clap(arg_required_else_help = true)] NamedWorkspaceCustomLayoutRule(NamedWorkspaceCustomLayoutRule), - /// Toggle the behaviour for new windows (stacking or dynamic tiling) - ToggleWindowContainerBehaviour, - /// Toggle the behaviour for new windows (stacking or dynamic tiling) for currently focused - /// workspace. If there was no behaviour set for the workspace previously it takes the opposite - /// of the global value. - ToggleWorkspaceWindowContainerBehaviour, /// Toggle native maximization for the focused window ToggleMaximize, /// Restore all hidden windows (debugging command) @@ -512,14 +450,6 @@ pub enum WindowsCommands { /// Set the window behaviour when switching workspaces / cycling stacks #[clap(arg_required_else_help = true)] WindowHidingBehaviour(OneEnum), - /// Set the behaviour when focusing in a direction while a monocle container is active - #[clap(arg_required_else_help = true)] - MonocleFocusBehaviour(MonocleFocusBehaviour), - /// Toggle the behaviour when focusing in a direction while a monocle container is active - ToggleMonocleFocusBehaviour, - /// Set the operation behaviour when the focused window is not managed - #[clap(arg_required_else_help = true)] - UnmanagedWindowOperationBehaviour(OneEnum), /// Identify an application that sends EVENT_OBJECT_NAMECHANGE on launch #[clap(arg_required_else_help = true)] IdentifyObjectNameChangeApplication(ApplicationTarget), @@ -538,10 +468,6 @@ pub enum WindowsCommands { #[clap(hide = true)] #[clap(alias = "identify-border-overflow")] IdentifyBorderOverflowApplication(ApplicationTarget), - /// Set the colour for a window border kind - #[clap(arg_required_else_help = true)] - #[clap(alias = "active-window-border-colour")] - BorderColour(BorderColour), /// Set the border style #[clap(arg_required_else_help = true)] BorderStyle(BorderStyle), diff --git a/komorebi-for-kde/komorebic/src/main.rs b/komorebi-for-kde/komorebic/src/main.rs index da0e7c69..45a2a6a9 100644 --- a/komorebi-for-kde/komorebic/src/main.rs +++ b/komorebi-for-kde/komorebic/src/main.rs @@ -126,8 +126,6 @@ use clap::Subcommand; use color_eyre::eyre; use fs_tail::TailedFile; use komorebi_client::FocusFollowsMouseImplementation; -use komorebi_client::OperationBehaviour; -use komorebi_client::OperationDirection; use komorebi_client::PanDirection; use komorebi_client::PathExt; use komorebi_client::SocketMessage; @@ -365,29 +363,9 @@ enum KdeCommands { Log, // /// Forcibly focus the window at the cursor with a left mouse click // ForceFocus, - /// Focus the first managed window matching the given executable - #[clap(arg_required_else_help = true)] - EagerFocus(EagerFocus), // /// Set the invisible border dimensions around each window // #[clap(arg_required_else_help = true)] // InvisibleBorders(InvisibleBorders), - /// Set the number of visible columns for the Scrolling layout on the focused workspace - #[clap(arg_required_else_help = true)] - ScrollingLayoutColumns(ScrollingLayoutColumns), - /// Make the focused column of the Scrolling layout as wide as the screen, or put it back to - /// the width that it had - ScrollingLayoutFullWidth, - /// Scroll the Scrolling layout so that the focused column is in the middle of the screen, once - CenterFocus, - /// Take the neighbouring window on one side into the focused column of the Scrolling layout - #[clap(arg_required_else_help = true)] - Consume(OneEnum), - /// Take the focused window out of its column in the Scrolling layout and put it in a column - /// of its own on the right - Expel, - /// Stack the windows of the focused column of the Scrolling layout, or spread the focused - /// stack out into a column with a window in each slot - ToggleColumnStack, /// Move the view of the Scrolling layout a column to the left or the right, which does /// nothing in any other layout #[clap(arg_required_else_help = true)] @@ -398,10 +376,6 @@ enum KdeCommands { // #[clap(hide = true)] // #[clap(arg_required_else_help = true)] // LoadCustomLayout(LoadCustomLayout), - /// Promote the user focus to the largest window container - PromoteFocus, - /// Force the retiling of all managed windows - Retile, // /// Set the monitor index preference for a monitor identified using its size // #[clap(arg_required_else_help = true)] // MonitorIndexPreference(MonitorIndexPreference), @@ -421,26 +395,8 @@ enum KdeCommands { // #[clap(hide = true)] // #[clap(arg_required_else_help = true)] // NamedWorkspaceCustomLayoutRule(NamedWorkspaceCustomLayoutRule), - /// Toggle the behavior for new windows (stacking or dynamic tiling) - ToggleWindowContainerBehaviour, - /// Toggle the behavior for new windows (stacking or dynamic tiling) for currently focused - /// workspace. If there was no behavior set for the workspace previously it takes the opposite - /// of the global value. - ToggleWorkspaceWindowContainerBehaviour, /// Toggle the compositor's maximization for the focused window ToggleMaximize, - /// Set the behavior when focusing in a direction while a monocle container is active - #[clap(arg_required_else_help = true)] - MonocleFocusBehaviour(MonocleFocusBehaviour), - /// Toggle the behavior when focusing in a direction while a monocle container is active - ToggleMonocleFocusBehaviour, - /// Set the operation behavior when the focused window is not managed - #[clap(arg_required_else_help = true)] - UnmanagedWindowOperationBehaviour(OneEnum), - /// Set the color for a window border kind - #[clap(arg_required_else_help = true)] - #[clap(alias = "active-window-border-colour")] - BorderColour(BorderColour), // /// Set the border style // #[clap(arg_required_else_help = true)] // BorderStyle(BorderStyle), @@ -756,45 +712,9 @@ fn main() -> eyre::Result<()> { println!("{line}"); } } - KdeCommands::ToggleMonocleFocusBehaviour => { - send_message(&SocketMessage::ToggleMonocleFocusBehaviour)?; - } KdeCommands::ToggleMaximize => { send_message(&SocketMessage::ToggleMaximize)?; } - KdeCommands::Retile => { - send_message(&SocketMessage::Retile)?; - } - KdeCommands::PromoteFocus => { - send_message(&SocketMessage::PromoteFocus)?; - } - KdeCommands::ToggleWindowContainerBehaviour => { - send_message(&SocketMessage::ToggleWindowContainerBehaviour)?; - } - KdeCommands::ToggleWorkspaceWindowContainerBehaviour => { - send_message(&SocketMessage::ToggleWorkspaceWindowContainerBehaviour)?; - } - KdeCommands::EagerFocus(args) => { - send_message(&SocketMessage::EagerFocus(args.exe))?; - } - KdeCommands::ScrollingLayoutColumns(args) => { - send_message(&SocketMessage::ScrollingLayoutColumns(args.count))?; - } - KdeCommands::ScrollingLayoutFullWidth => { - send_message(&SocketMessage::ScrollingLayoutFullWidth)?; - } - KdeCommands::CenterFocus => { - send_message(&SocketMessage::CenterFocus)?; - } - KdeCommands::Consume(args) => { - send_message(&SocketMessage::Consume(args.value))?; - } - KdeCommands::Expel => { - send_message(&SocketMessage::Expel)?; - } - KdeCommands::ToggleColumnStack => { - send_message(&SocketMessage::ToggleColumnStack)?; - } KdeCommands::Pan(args) => { send_message(&SocketMessage::Pan(args.direction))?; } @@ -807,14 +727,6 @@ fn main() -> eyre::Result<()> { send_message(&SocketMessage::LayoutRatios(args.columns, args.rows))?; } } - KdeCommands::MonocleFocusBehaviour(args) => { - send_message(&SocketMessage::MonocleFocusBehaviour(args.behaviour))?; - } - KdeCommands::UnmanagedWindowOperationBehaviour(args) => { - send_message(&SocketMessage::UnmanagedWindowOperationBehaviour( - args.value, - ))?; - } KdeCommands::ApplicationSpecificConfigurationSchema => { #[cfg(feature = "schemars")] { @@ -851,14 +763,6 @@ fn main() -> eyre::Result<()> { KdeCommands::GenerateStaticConfig => { print_query(&SocketMessage::GenerateStaticConfig); } - KdeCommands::BorderColour(args) => { - send_message(&SocketMessage::BorderColour( - args.window_kind, - args.r, - args.g, - args.b, - ))?; - } KdeCommands::Transparency(args) => { send_message(&SocketMessage::Transparency(args.value.into()))?; } diff --git a/komorebi-for-mac/komorebic/src/main.rs b/komorebi-for-mac/komorebic/src/main.rs index 953fdbd0..ac9ee063 100644 --- a/komorebi-for-mac/komorebic/src/main.rs +++ b/komorebi-for-mac/komorebic/src/main.rs @@ -706,21 +706,6 @@ exit 1 println!("{line}"); } } - MacosCommands::Retile => { - send_message(&SocketMessage::Retile)?; - } - MacosCommands::PromoteFocus => { - send_message(&SocketMessage::PromoteFocus)?; - } - MacosCommands::ToggleWindowContainerBehaviour => { - send_message(&SocketMessage::ToggleWindowContainerBehaviour)?; - } - MacosCommands::ToggleWorkspaceWindowContainerBehaviour => { - send_message(&SocketMessage::ToggleWorkspaceWindowContainerBehaviour)?; - } - MacosCommands::ToggleMonocleFocusBehaviour => { - send_message(&SocketMessage::ToggleMonocleFocusBehaviour)?; - } MacosCommands::FetchAppSpecificConfiguration => { let content = reqwest::blocking::get("https://raw.githubusercontent.com/LGUG2Z/komorebi-application-specific-configuration/master/applications.mac.json")? .text()?; @@ -743,27 +728,6 @@ exit 1 output_file.display().to_string().replace("\\", "/") ); } - MacosCommands::EagerFocus(args) => { - send_message(&SocketMessage::EagerFocus(args.exe))?; - } - MacosCommands::ScrollingLayoutColumns(args) => { - send_message(&SocketMessage::ScrollingLayoutColumns(args.count))?; - } - MacosCommands::ScrollingLayoutFullWidth => { - send_message(&SocketMessage::ScrollingLayoutFullWidth)?; - } - MacosCommands::CenterFocus => { - send_message(&SocketMessage::CenterFocus)?; - } - MacosCommands::Consume(args) => { - send_message(&SocketMessage::Consume(args.value))?; - } - MacosCommands::Expel => { - send_message(&SocketMessage::Expel)?; - } - MacosCommands::ToggleColumnStack => { - send_message(&SocketMessage::ToggleColumnStack)?; - } MacosCommands::Pan(args) => { // a flag that has a default counts as given, so what only goes with --stream // cannot be left to the parser to say @@ -799,14 +763,6 @@ exit 1 send_message(&SocketMessage::LayoutRatios(args.columns, args.rows))?; } } - MacosCommands::MonocleFocusBehaviour(args) => { - send_message(&SocketMessage::MonocleFocusBehaviour(args.behaviour))?; - } - MacosCommands::UnmanagedWindowOperationBehaviour(args) => { - send_message(&SocketMessage::UnmanagedWindowOperationBehaviour( - args.value, - ))?; - } MacosCommands::ApplicationSpecificConfigurationSchema => { #[cfg(feature = "schemars")] { @@ -843,14 +799,6 @@ exit 1 MacosCommands::GenerateStaticConfig => { print_query(&SocketMessage::GenerateStaticConfig); } - MacosCommands::BorderColour(args) => { - send_message(&SocketMessage::BorderColour( - args.window_kind, - args.r, - args.g, - args.b, - ))?; - } }, } diff --git a/komorebic/src/main.rs b/komorebic/src/main.rs index a10b5ad2..82112c8e 100644 --- a/komorebic/src/main.rs +++ b/komorebic/src/main.rs @@ -645,15 +645,6 @@ fn main() -> eyre::Result<()> { WindowsCommands::ForceFocus => { send_message(&SocketMessage::ForceFocus)?; } - WindowsCommands::PromoteFocus => { - send_message(&SocketMessage::PromoteFocus)?; - } - WindowsCommands::Retile => { - send_message(&SocketMessage::Retile)?; - } - WindowsCommands::EagerFocus(args) => { - send_message(&SocketMessage::EagerFocus(args.exe))?; - } WindowsCommands::InvisibleBorders(args) => { send_message(&SocketMessage::InvisibleBorders(Rect { left: args.left, @@ -1165,24 +1156,6 @@ if (Get-Command Get-CimInstance -ErrorAction SilentlyContinue) { } } } - WindowsCommands::ScrollingLayoutColumns(args) => { - send_message(&SocketMessage::ScrollingLayoutColumns(args.count))?; - } - WindowsCommands::ScrollingLayoutFullWidth => { - send_message(&SocketMessage::ScrollingLayoutFullWidth)?; - } - WindowsCommands::CenterFocus => { - send_message(&SocketMessage::CenterFocus)?; - } - WindowsCommands::Consume(args) => { - send_message(&SocketMessage::Consume(args.value))?; - } - WindowsCommands::Expel => { - send_message(&SocketMessage::Expel)?; - } - WindowsCommands::ToggleColumnStack => { - send_message(&SocketMessage::ToggleColumnStack)?; - } WindowsCommands::Pan(args) => { // a flag that has a default counts as given, so what only goes with --stream // cannot be left to the parser to say @@ -1305,14 +1278,6 @@ if (Get-Command Get-CimInstance -ErrorAction SilentlyContinue) { WindowsCommands::UnsubscribePipe(args) => { send_message(&SocketMessage::RemoveSubscriberPipe(args.named_pipe))?; } - WindowsCommands::BorderColour(args) => { - send_message(&SocketMessage::BorderColour( - args.window_kind, - args.r, - args.g, - args.b, - ))?; - } WindowsCommands::BorderStyle(args) => { send_message(&SocketMessage::BorderStyle(args.style))?; } @@ -1332,26 +1297,9 @@ if (Get-Command Get-CimInstance -ErrorAction SilentlyContinue) { send_message(&SocketMessage::ToggleTransparency)?; } - WindowsCommands::ToggleWindowContainerBehaviour => { - send_message(&SocketMessage::ToggleWindowContainerBehaviour)?; - } - WindowsCommands::ToggleWorkspaceWindowContainerBehaviour => { - send_message(&SocketMessage::ToggleWorkspaceWindowContainerBehaviour)?; - } WindowsCommands::WindowHidingBehaviour(args) => { send_message(&SocketMessage::WindowHidingBehaviour(args.value))?; } - WindowsCommands::MonocleFocusBehaviour(args) => { - send_message(&SocketMessage::MonocleFocusBehaviour(args.behaviour))?; - } - WindowsCommands::ToggleMonocleFocusBehaviour => { - send_message(&SocketMessage::ToggleMonocleFocusBehaviour)?; - } - WindowsCommands::UnmanagedWindowOperationBehaviour(args) => { - send_message(&SocketMessage::UnmanagedWindowOperationBehaviour( - args.value, - ))?; - } WindowsCommands::AhkAppSpecificConfiguration(args) => { let content = std::fs::read_to_string(args.path)?; let lines = if let Some(override_path) = args.override_path {