Skip to main content
Glama
alderban107

hyprland-mcp

by alderban107

focus_window

Focus a specific window in Hyprland by class or title to manage desktop automation tasks. Use window selectors like "class:firefox" or "title:My Document" to target windows.

Instructions

Focus a window by class or title.

Args: target: Window selector — "class:firefox", "title:My Document", etc.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
targetYes

Implementation Reference

  • The 'focus_window' tool is defined as an async function in 'server.py' using the 'mcp.tool()' decorator. It takes a 'target' string and calls 'hyprctl.dispatch("focuswindow", target)' to execute the focus action via Hyprland.
    @mcp.tool()
    async def focus_window(target: str) -> str:
        """Focus a window by class or title.
    
        Args:
            target: Window selector — "class:firefox", "title:My Document", etc.
        """
        await hyprctl.dispatch("focuswindow", target)
        return f"Focused window matching '{target}'"

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/alderban107/hyprland-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server