feat(cli): add move/send-to-last-workspace cmds

This commit adds two new komorebic commands, move-to-last-workspace and
send-to-last-workspace, which move or send the focused window to the
last focused workspace on the focused monitor.
This commit is contained in:
LGUG2Z
2025-03-23 16:07:41 -07:00
parent a8c687d3d5
commit e702d93a8a
11 changed files with 119 additions and 8 deletions

View File

@@ -1104,6 +1104,10 @@ enum SubCommand {
/// Move the focused window to the specified monitor workspace
#[clap(arg_required_else_help = true)]
MoveToMonitorWorkspace(MoveToMonitorWorkspace),
/// Send the focused window to the last focused monitor workspace
SendToLastWorkspace,
/// Move the focused window to the last focused monitor workspace
MoveToLastWorkspace,
/// Focus the specified monitor
#[clap(arg_required_else_help = true)]
FocusMonitor(FocusMonitor),
@@ -1857,6 +1861,12 @@ fn main() -> Result<()> {
arg.cycle_direction,
))?;
}
SubCommand::MoveToLastWorkspace => {
send_message(&SocketMessage::MoveContainerToLastWorkspace)?;
}
SubCommand::SendToLastWorkspace => {
send_message(&SocketMessage::SendContainerToLastWorkspace)?;
}
SubCommand::SwapWorkspacesWithMonitor(arg) => {
send_message(&SocketMessage::SwapWorkspacesToMonitorNumber(arg.target))?;
}