Skip to content

GlazeWM is a tiling window manager for macOS and Windows inspired by i3wm.

feat: add `--workspace-in-direction` to `move` command (#985)

Shamo Kwokc0d97b9a7e3f
diff --git a/packages/wm-common/src/app_command.rs b/packages/wm-common/src/app_command.rs
index 4970dd38..23822184 100644
--- a/packages/wm-common/src/app_command.rs
+++ b/packages/wm-common/src/app_command.rs
@@ -343,6 +343,10 @@ pub struct InvokeMoveCommand {
#[clap(long)]
pub direction: Option<Direction>,
+ /// Move window to workspace in specified direction.
+ #[clap(long)]
+ pub workspace_in_direction: Option<Direction>,
+
/// Name of workspace to move the window.
#[clap(long)]
pub workspace: Option<String>,
diff --git a/packages/wm/src/wm.rs b/packages/wm/src/wm.rs
index 448e276c..6760c954 100644
--- a/packages/wm/src/wm.rs
+++ b/packages/wm/src/wm.rs
@@ -303,6 +303,15 @@ impl WindowManager {
)?;
}
+ if let Some(direction) = &args.workspace_in_direction {
+ move_window_to_workspace(
+ window.clone(),
+ WorkspaceTarget::Direction(direction.clone()),
+ state,
+ config,
+ )?;
+ }
+
if let Some(name) = &args.workspace {
move_window_to_workspace(
window.clone(),