agentleFS
hdprajwalhdprajwal/agent-skills/skills/screen-capture/SKILL.md

screen-capture

Skill1 starsChanged 5 months agoMITView on GitHub

Take screenshots on Wayland/Hyprland with grim + slurp — full screen, a chosen monitor, an interactive region, or the active window — and save to a file or pipe to the clipboard. Use whenever an agent needs to see the screen, capture UI state, grab a region for analysis, or produce an image to reason over. The "eyes" for visual computer use.

1 other project uses a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    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. Very specific:

    After saving, Read the image file to analyze it — that's how the agent "sees" the result.

    line 58

≈ “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

Screen Capture (Wayland / Hyprland)

grim captures; slurp selects a region interactively; hyprctl + jq give geometry for non-interactive captures. Output goes to a file or to wl-copy.

Requires grim and slurp (both present on this machine). Wayland only — scrot /maim won't work here.

Full screen

grim ~/screenshot.png                 # focused output (or all, depending on setup)
grim -o "$(hyprctl monitors -j | jq -r '.[] | select(.focused).name')" ~/focused-monitor.png

Interactive region (you draw the box)

grim -g "$(slurp)" ~/region.png

Active window — no interaction

geom=$(hyprctl activewindow -j | jq -r '"\(.at[0]),\(.at[1]) \(.size[0])x\(.size[1])"')
grim -g "$geom" ~/active-window.png

Pick a specific window by class — no interaction

geom=$(hyprctl clients -j | jq -r '.[] | select(.class=="firefox") | "\(.at[0]),\(.at[1]) \(.size[0])x\(.size[1])"' | head -1)
grim -g "$geom" ~/firefox.png

To the clipboard (no file)

grim - | wl-copy --type image/png                    # full screen → clipboard
grim -g "$(slurp)" - | wl-copy --type image/png      # region → clipboard

Smaller / compressed (good for feeding to a model)

grim -t jpeg -q 75 ~/shot.jpg        # JPEG at quality 75
grim -t png -l 6 ~/shot.png          # PNG compression level

Reading it back

After saving, Read the image file to analyze it — that's how the agent "sees" the result. Keep captures in /tmp or a scratch dir and clean up after.

Gotchas

  • Scaling: grim saves at the output's physical pixel resolution. If a monitor has scale ≠ 1 (hyprctl monitors -j | jq '.[].scale'), image pixels = logical × scale. To turn a pixel you see in the screenshot into a cursor coordinate, divide by scale. This is the #1 mistake when clicking from a screenshot — see visual-computer-use-loop.
  • Multi-monitor: without -o/-g, grim may stitch all outputs; pass -o for one monitor or -g for an exact box.
  • Timing: capture after the UI has settled; add a brief wait after launching or focusing a window before grabbing it.

Pairs with

  • hyprland-control — geometry of windows/monitors to capture.
  • visual-computer-use-loop — capture → reason → act → re-capture.
  • screen-recording — for motion instead of a still (separate skill).

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.