move_window
Move windows to specific screen positions or workspaces in Hyprland desktop environments. Use coordinates for precise placement or workspace names for organization.
Instructions
Move a window to a position or workspace.
Args: target: Window selector. If omitted, moves the active window. x: Target X position in pixels y: Target Y position in pixels workspace: Target workspace name/number to move the window to
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| target | No | ||
| x | No | ||
| y | No | ||
| workspace | No |
Implementation Reference
- hyprland_mcp/server.py:133-161 (handler)The `move_window` tool handler function, which dispatches `movewindowpixel` or `movetoworkspace` commands to Hyprland based on the provided arguments.
@mcp.tool() async def move_window( target: str | None = None, x: int | None = None, y: int | None = None, workspace: str | None = None, ) -> str: """Move a window to a position or workspace. Args: target: Window selector. If omitted, moves the active window. x: Target X position in pixels y: Target Y position in pixels workspace: Target workspace name/number to move the window to """ results = [] addr = target or "" if x is not None and y is not None: await hyprctl.dispatch("movewindowpixel", f"exact {x} {y},{addr}") results.append(f"Moved to ({x},{y})") if workspace is not None: if target: await hyprctl.dispatch("movetoworkspace", f"{workspace},{target}") else: await hyprctl.dispatch("movetoworkspace", workspace) results.append(f"Moved to workspace {workspace}") if not results: return "No position or workspace specified — nothing to do." return "; ".join(results)