toggle_floating
Switch a window between floating and tiled modes. Specify a target window or toggle the active window's layout.
Instructions
Toggle floating mode for a window.
Args: target: Window selector. If omitted, toggles the active window.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| target | No |
Implementation Reference
- hyprland_mcp/server.py:193-201 (handler)The `toggle_floating` tool handler is defined in `server.py` using the `@mcp.tool()` decorator. It dispatches a 'togglefloating' command to the Hyprland server via the `hyprctl` helper.
@mcp.tool() async def toggle_floating(target: str | None = None) -> str: """Toggle floating mode for a window. Args: target: Window selector. If omitted, toggles the active window. """ await hyprctl.dispatch("togglefloating", target or "") return f"Toggled floating{f' for {target}' if target else ''}"