capturing-tk-screenshots-headless

Installation
SKILL.md

Capturing Tk screenshots headless

Overview

Run the GUI on a virtual X server (Xvfb) and capture with ImageMagick import. There is no window manager: no title bars, every window opens at 0,0, and import -window <id> copies whatever is on screen in that window's rectangle, including other windows covering it.

Before you start

  • Use a Python that has tkinter: python -c "import tkinter". Sandbox system python3 often lacks it; a venv with Thonny or python3-tk has it.
  • Tools: Xvfb, xvfb-run, import, convert (ImageMagick). Often missing: xdotool, xwininfo, scrot. Don't plan on them.
Installs
2
First Seen
4 days ago