agentleFS
hdprajwalhdprajwal/agent-skills/skills/gui-input-automation/SKILL.md

gui-input-automation

Skill1 starsChanged 5 months agoMITView on GitHub

Send synthetic keyboard and mouse input on Wayland/Hyprland — type text, press key combos, move the cursor, click, scroll, drag. Use wtype for keyboard (no setup, rootless) and ydotool for the mouse (needs a one-time uinput/daemon setup the skill walks through). The "hands" for visual computer use. Wayland only — xdotool does not work here.

The file

We split this skill into the rules it gives an agent

2 rules. About 0 are common, 1 is distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Verify it's working:

    line 54
  2. Very specific:

    If the client errors with a socket problem, find the socket ydotoold created and export it: export …

    line 60

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

GUI Input Automation (Wayland / Hyprland)

Two tools, split by what they do best on Wayland:

  • wtype — keyboard: type text, press keys and modifier combos. Rootless, no daemon, uses the virtual-keyboard protocol Hyprland supports. Prefer this for anything keyboard.
  • ydotool — mouse: move, click, scroll, drag (and keyboard via uinput if you need global input). Needs /dev/uinput access and a running ydotoold.

Both packages are in the official repo: sudo pacman -S wtype ydotool.

Keyboard with wtype (no setup)

wtype "hello world"            # type a string into the focused window
wtype -k Return               # press a named key (Tab, Escape, Left, BackSpace…)
wtype -k Tab
wtype -M ctrl c -m ctrl       # Ctrl+C  (-M press modifier, -m release)
wtype -M ctrl -M shift t -m shift -m ctrl   # Ctrl+Shift+T

Focus the target window first (see hyprland-control) — input goes to whatever is focused. Add a small wait after focusing before typing.

Mouse with ydotool — one-time setup

Your user is not in the input group yet, so do this once:

# 1. udev rule so /dev/uinput is group-accessible
echo 'KERNEL=="uinput", GROUP="input", MODE="0660", OPTIONS+="static_node=uinput"' \
  | sudo tee /etc/udev/rules.d/80-uinput.rules
sudo udevadm control --reload && sudo udevadm trigger

# 2. add yourself to the input group, then RE-LOGIN (or reboot) for it to apply
sudo usermod -aG input "$USER"

Then run the daemon (re-run after each login, or enable a service):

ydotoold &                                   # manual
# if a unit ships with the package:
systemctl --user enable --now ydotool 2>/dev/null || systemctl --user status ydotool

Verify it's working:

ydotool mousemove --absolute -x 100 -y 100   # cursor should jump to (100,100)

If the client errors with a socket problem, find the socket ydotoold created and export it: export YDOTOOL_SOCKET=$XDG_RUNTIME_DIR/.ydotool_socket (or /tmp/.ydotool_socket), then retry.

Mouse actions

ydotool mousemove --absolute -x 960 -y 540   # move to absolute pixel (compositor space)
ydotool mousemove -x 20 -y 0                 # move relative
ydotool click 0xC0                           # left click   (0xC1 right, 0xC2 middle)
ydotool click --repeat 2 --next-delay 25 0xC0  # double-click
ydotool mousemove -a -x 500 -y 500 && ydotool click 0xC0   # move then click

# drag: press at A, move to B, release
ydotool click 0x40   # press-left only (0x40)
ydotool mousemove -a -x 800 -y 600
ydotool click 0x80   # release-left only (0x80)

Button byte = 0x80 press-bit | 0x40 release-bit | button (0=left, 1=right, 2=middle). So 0xC0 = full left click, 0x40=press, 0x80=release.

Coordinate space — read this before clicking from a screenshot

ydotool mousemove --absolute uses compositor logical pixels — the same space as hyprctl cursorpos. A grim screenshot is in physical pixels. If the monitor scale ≠ 1, convert: logical = screenshot_pixel / scale. Get scale from hyprctl monitors -j | jq '.[].scale'. Calibrate once: move to a known target, screenshot, check the offset. The visual-computer-use-loop skill bakes this in.

Safety

  • Synthetic input acts on the real desktop — it can click anything.
  • Confirm before clicks that submit, delete, or pay. Move slowly, one action at a time, and verify with a screenshot after each (see visual-computer-use-loop).
  • wtype is harmless to set up; ydotool grants uinput input injection — only enable it knowingly.

Pairs with

  • hyprland-control — focus the right window before typing.
  • screen-capture — see the target and confirm the result.
  • visual-computer-use-loop — the full see-think-act cycle.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.