mirror of
https://github.com/LGUG2Z/komorebi.git
synced 2026-07-05 12:41:47 +02:00
feat(cli): add cycle-layout command (#556)
* Command to ToggleLayout * Just improve logic of figuring out next layout * Addr review: rename to "Cycle" instead of toggle, and add a small comment * As per review comments, implement cycle method on DefaultLayout * I forgot to remove this, my bad * feat(cli): fixups for cycle-layout cmd * Update komorebic/src/main.rs Co-authored-by: Kushashwa Ravi Shrimali <kushashwaravishrimali@gmail.com> --------- Co-authored-by: LGUG2Z <jadeiqbal@fastmail.com> Co-authored-by: جاد <LGUG2Z@users.noreply.github.com>
This commit is contained in:
committed by
LGUG2Z
parent
557d1962a7
commit
e9fb9297e9
@@ -125,6 +125,7 @@ gen_enum_subcommand_args! {
|
||||
CycleStack: CycleDirection,
|
||||
FlipLayout: Axis,
|
||||
ChangeLayout: DefaultLayout,
|
||||
CycleLayout: CycleDirection,
|
||||
WatchConfiguration: BooleanState,
|
||||
MouseFollowsFocus: BooleanState,
|
||||
Query: StateQuery,
|
||||
@@ -865,6 +866,9 @@ enum SubCommand {
|
||||
/// Set the layout on the focused workspace
|
||||
#[clap(arg_required_else_help = true)]
|
||||
ChangeLayout(ChangeLayout),
|
||||
/// Cycle between available layouts
|
||||
#[clap(arg_required_else_help = true)]
|
||||
CycleLayout(CycleLayout),
|
||||
/// Load a custom layout from file for the focused workspace
|
||||
#[clap(arg_required_else_help = true)]
|
||||
LoadCustomLayout(LoadCustomLayout),
|
||||
@@ -1678,6 +1682,9 @@ Stop-Process -Name:whkd -ErrorAction SilentlyContinue
|
||||
SubCommand::ChangeLayout(arg) => {
|
||||
send_message(&SocketMessage::ChangeLayout(arg.default_layout).as_bytes()?)?;
|
||||
}
|
||||
SubCommand::CycleLayout(arg) => {
|
||||
send_message(&SocketMessage::CycleLayout(arg.cycle_direction).as_bytes()?)?;
|
||||
}
|
||||
SubCommand::LoadCustomLayout(arg) => {
|
||||
send_message(
|
||||
&SocketMessage::ChangeLayoutCustom(resolve_windows_path(&arg.path)?).as_bytes()?,
|
||||
|
||||
Reference in New Issue
Block a user