"Control the local Ubuntu desktop mouse, keyboard and screenshots using pyautogui and xdotool."
Resources
11Install
npx skillscat add jaimeunburied296/screen-cotrol-for-ubuntu Install via the SkillsCat registry.
SKILL.md
What this skill does
This skill lets the agent control the local Ubuntu VM desktop:
- Move the mouse to a given coordinate
- Click / right-click / double-click
- Drag from one point to another
- Scroll at a given location
- Type text
- Trigger common hotkeys (copy / paste / select all / undo / redo / address bar / refresh)
- Press single keys like Enter / Esc / Tab reliably
- Focus target windows by title before actions
- Probe current active window + mouse position (focus-probe)
- Retry click around a base point to handle small offset errors (click-retry)
- Take full-screen screenshots and save them to disk
All commands are executed via this Python script and virtualenv:
- Script:
/home/moderlick/tools/screen_tool.py - Python:
/home/moderlick/tools/screen-env/.venv/bin/python
Always call it like:
/home/moderlick/tools/screen-env/.venv/bin/python /home/moderlick/tools/screen_tool.py <subcommand> [options...]Session note:
- Prefer Xorg (x11) session for reliable mouse/keyboard control.
- Under Wayland, pyautogui input simulation may fail due to compositor security restrictions.
Move the mouse
/home/moderlick/tools/screen-env/.venv/bin/python /home/moderlick/tools/screen_tool.py move --position 255,255Click
/home/moderlick/tools/screen-env/.venv/bin/python /home/moderlick/tools/screen_tool.py click --position 400,300
/home/moderlick/tools/screen-env/.venv/bin/python /home/moderlick/tools/screen_tool.py click --position 400,300 --right
/home/moderlick/tools/screen-env/.venv/bin/python /home/moderlick/tools/screen_tool.py click --position 400,300 --doubleDrag
/home/moderlick/tools/screen-env/.venv/bin/python /home/moderlick/tools/screen_tool.py drag --start 100,100 --end 600,400 --duration 0.8Scroll
/home/moderlick/tools/screen-env/.venv/bin/python /home/moderlick/tools/screen_tool.py scroll --position 800,400 --amount -500Type text
/home/moderlick/tools/screen-env/.venv/bin/python /home/moderlick/tools/screen_tool.py type --text "Hello from OpenClaw"Hotkeys
/home/moderlick/tools/screen-env/.venv/bin/python /home/moderlick/tools/screen_tool.py hotkey --combo copy
/home/moderlick/tools/screen-env/.venv/bin/python /home/moderlick/tools/screen_tool.py hotkey --combo address_barPress single key
/home/moderlick/tools/screen-env/.venv/bin/python /home/moderlick/tools/screen_tool.py press --key enter
/home/moderlick/tools/screen-env/.venv/bin/python /home/moderlick/tools/screen_tool.py press --key escFocus window
/home/moderlick/tools/screen-env/.venv/bin/python /home/moderlick/tools/screen_tool.py focus --name "Firefox|火狐"Focus probe (check active window + mouse)
/home/moderlick/tools/screen-env/.venv/bin/python /home/moderlick/tools/screen_tool.py focus-probeClick retry (small-offset compensation)
/home/moderlick/tools/screen-env/.venv/bin/python /home/moderlick/tools/screen_tool.py click-retry --position 1148,768 --radius 30 --step 8 --retries 5Recommended web workflow:
- focus Firefox
- focus-probe
- click-retry on target input area
- type text
- press enter
Screenshots
/home/moderlick/tools/screen-env/.venv/bin/python /home/moderlick/tools/screen_tool.py screenshot