Warning
Experimental & Under Active Development This compositor plugin and setup are under active, experimental development and are not a final-grade production product. Due to the rapid evolution of Wayland, Hyprland APIs, and D-Bus/AT-SPI protocols, some components or features may occasionally break, fail to target properly, or require manual adjustments on different hardware and software configurations. Use with caution in production workflows.
A high-performance C++ Hyprland compositor plugin that exposes window geometries, active focus states, and direct cursor warps via a Unix domain socket /tmp/hermes-hyprland.sock.
When paired with our Python Coordinate Fusion Engine, it maps absolute screen targets for client-side applications (like Chrome, Zen Browser, Thunar, etc.) by combining compositor-level window coordinates with D-Bus AT-SPI accessibility trees.
Modern Wayland client applications (GTK, Qt, Electron, Chromium) are mathematically sandboxed—they do not know their absolute position on the physical screen for security reasons. As a result, accessibility frameworks (AT-SPI) report element coordinates relative to the window frame origin
To bypass this Wayland limitation and achieve absolute pixel-perfect desktop automation, this system implements Coordinate Fusion:
By combining the compositor's window origin (ground truth) with relative D-Bus element boundaries, we resolve target coordinates in less than 1 millisecond with 100% targeting precision, entirely bypassing slow, vision-based coordinate guessing.
Communicate with the plugin by sending JSON payloads over the active Unix Domain Socket.
| Action | Parameters | Returns | Description |
|---|---|---|---|
ping |
None | { "success": true, "message": "..." } |
Health check verifying the socket is responsive. |
get_windows |
None | { "success": true, "windows": [...] } |
Enumerates mapped window classes, titles, addresses, geometries, and focus states. |
get_cursor |
None | { "success": true, "cursor": { "x", "y" } } |
Retrieves the real-time mouse coordinate. |
get_active |
None | { "success": true, "class", "title", "x", "y", "width", "height" } |
Returns properties of the currently focused window. |
get_clickable_regions |
class (optional) |
{ "success": true, "windows": [...] } |
Retrieves compositor-level subsurfaces and active input regions. |
move_cursor |
x, y |
{ "success": true, "x", "y" } |
Warps the mouse pointer directly to absolute screen coordinate (x, y). |
focus_window |
class or title |
{ "success": true, "focused": "..." } |
Focuses the matching window via the compositor focus state manager. |
sudo pacman -S hyprland nlohmann-json libdrm pixman cmakecmake -B build -DCMAKE_BUILD_TYPE=Release
cmake --build buildThis produces build/hermes-hyprland.so (size ~220KB).
hyprctl plugin load ./build/hermes-hyprland.soAdd the following line to ~/.config/hypr/hyprland.conf:
plugin = /home/captain/hermes-hyprland-plugin/build/hermes-hyprland.soOur repository contains a standalone coordinate fusion client. It maps active compositor layouts to local D-Bus elements.
Verify the socket, D-Bus bridges, and live calculations with:
chmod +x hermes_hyprland_fusion.py
./hermes_hyprland_fusion.pyfrom hermes_hyprland_fusion import CoordinateFusionEngine
# Initialize the engine
engine = CoordinateFusionEngine()
# Get all accessible UI elements with absolute coordinates fused!
elements = engine.get_clickable_elements(target_app_class="thunar")
for el in elements[:5]:
cx, cy = el.center()
print(f"Index #{el.index}: {el.role} '{el.label}' at absolute screen position: X={cx}, Y={cy}")The coordinate fusion engine is fully integrated inside the Hermes Agent at /home/captain/.hermes/hermes-agent/tools/computer_use/:
- hyprland_backend.py: Adapts coordinates, screenshotting (via
grim), SOM bubble overlays (viaPillow), and input injection (viaydotool) into theComputerUseBackendstandard. - tool.py: Mounts the Hyprland driver switch block and configures OS validation.
To start Hermes with absolute, visionless coordinate targeting enabled:
export HERMES_COMPUTER_USE_BACKEND=hyprland
python3 cli.pyThis allows the agent to navigate folders, click menus, type text, and scroll in under 5 milliseconds per action with absolute accuracy.
This project is licensed under the MIT License. Developed by xCaptaiN09.