send_shortcut
Send keyboard shortcuts to control applications in Hyprland desktop environments. Specify modifier keys, target keys, and optionally target specific windows for automation.
Instructions
Send a keyboard shortcut via Hyprland (can target specific windows).
Args: mods: Modifier keys (e.g. "CTRL", "SUPER SHIFT", "ALT CTRL", or "" for none) key: Key name (e.g. "c", "F4", "Return", "space") target: Optional window selector (e.g. "class:firefox"). Empty = active window.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mods | Yes | ||
| key | Yes | ||
| target | No |
Implementation Reference
- hyprland_mcp/server.py:360-371 (handler)The `send_shortcut` tool implementation, which dispatches the "sendshortcut" command to hyprctl.
async def send_shortcut(mods: str, key: str, target: str | None = None) -> str: """Send a keyboard shortcut via Hyprland (can target specific windows). Args: mods: Modifier keys (e.g. "CTRL", "SUPER SHIFT", "ALT CTRL", or "" for none) key: Key name (e.g. "c", "F4", "Return", "space") target: Optional window selector (e.g. "class:firefox"). Empty = active window. """ target_str = target or "" await hyprctl.dispatch("sendshortcut", f"{mods}, {key}, {target_str}") desc = f"{mods}+{key}" if mods else key return f"Sent shortcut {desc}{f' to {target}' if target else ''}"