capta is a minimal, fast screenshot utility for X11. No daemons, no config files, no GUI overhead.
- Full-screen capture
- Focused window capture
- Interactive region or window selection with a crosshair cursor
- Capture delay (useful for menus and tooltips)
- Image quality control from 1 to 100
- Auto-generated timestamped filenames when no output path is given
Requires libX11 and Imlib2 development headers.
git clone --depth 1 https://github.com/tinyopsec/capta
cd capta
make
sudo make installcapta [-s] [-u] [-d sec] [-q 1-100] [file]
| Flag | Description |
|---|---|
-s |
Select a region or window with the mouse |
-u |
Capture the currently focused window |
-d sec |
Delay sec seconds before capturing |
-q num |
Image quality 1-100 (default 75) |
file |
Output path; auto-named if omitted |
capta # full screen, auto-named
capta screenshot.png # full screen to a file
capta -s # select a region
capta -s -q 95 region.jpg # select, high quality JPEG
capta -u window.png # focused window
capta -d 3 # 3-second delay, then full screen
capta -d 2 -s capture.png # delay then selectcapta
├── parseargs() parse CLI flags
├── initx() connect to X display, configure Imlib2 context
├── [sleep delay]
├── grab
| ├── grabfull() imlib_create_image_from_drawable (root, full size)
| ├── grabfocused() XGetInputFocus -> grabwin()
| └── grabsel() XGrabPointer + XOR rubber-band -> grabwin() or rect
└── saveimg() imlib_save_image_with_error_return
A drag smaller than 2x2 px in selection mode captures the window under the cursor rather than a region.
capta/
├── capta.c main logic: argument parsing, grab strategies, entry point
├── imlib.c X11 init and Imlib2 save wrapper
├── imlib.h shared display/screen globals and function declarations
├── Makefile build, install, clean targets
└── LICENSE MIT
Patches and bug reports are welcome. Keep C99, avoid extra dependencies, avoid dynamic allocation where unnecessary.
make clean && makeMIT - see LICENSE.
