feat(komorebic): add change-layout command

The handler for this was already hooked up in process_command.rs, but I
had forgotten to add the command to the cli.

resolve #14
This commit is contained in:
LGUG2Z
2021-08-18 16:39:01 -07:00
parent c7bf09e34b
commit 98f731ba13

View File

@@ -64,6 +64,7 @@ gen_enum_subcommand_args! {
Stack: OperationDirection, Stack: OperationDirection,
CycleStack: CycleDirection, CycleStack: CycleDirection,
FlipLayout: LayoutFlip, FlipLayout: LayoutFlip,
SetLayout: Layout,
WatchConfiguration: BooleanState, WatchConfiguration: BooleanState,
FocusFollowsMouse: BooleanState FocusFollowsMouse: BooleanState
} }
@@ -218,6 +219,8 @@ enum SubCommand {
/// Adjust workspace padding on the focused workspace /// Adjust workspace padding on the focused workspace
#[clap(setting = AppSettings::ArgRequiredElseHelp)] #[clap(setting = AppSettings::ArgRequiredElseHelp)]
AdjustWorkspacePadding(PaddingAdjustment), AdjustWorkspacePadding(PaddingAdjustment),
/// Set the layout on the focused workspace
ChangeLayout(SetLayout),
/// Flip the layout on the focused workspace (BSP only) /// Flip the layout on the focused workspace (BSP only)
FlipLayout(FlipLayout), FlipLayout(FlipLayout),
/// Promote the focused window to the top of the tree /// Promote the focused window to the top of the tree
@@ -419,6 +422,9 @@ fn main() -> Result<()> {
SubCommand::CycleStack(arg) => { SubCommand::CycleStack(arg) => {
send_message(&*SocketMessage::CycleStack(arg.cycle_direction).as_bytes()?)?; send_message(&*SocketMessage::CycleStack(arg.cycle_direction).as_bytes()?)?;
} }
SubCommand::ChangeLayout(arg) => {
send_message(&*SocketMessage::ChangeLayout(arg.layout).as_bytes()?)?;
}
SubCommand::FlipLayout(arg) => { SubCommand::FlipLayout(arg) => {
send_message(&*SocketMessage::FlipLayout(arg.layout_flip).as_bytes()?)?; send_message(&*SocketMessage::FlipLayout(arg.layout_flip).as_bytes()?)?;
} }