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 selectparseargs()parses the CLI flags.initx()connects to the X display and sets up the Imlib2 context.- If a delay was requested, capta sleeps for it.
- capta grabs the image using one of three strategies:
grabfull(): full-screen capture viaimlib_create_image_from_drawableon the root windowgrabfocused(): finds the focused window withXGetInputFocus, then hands off tograbwin()grabsel(): grabs the pointer and draws an XOR rubber-band selection, then callsgrabwin()on a window or crops to the selected rectangle
saveimg()writes the result out withimlib_save_image_with_error_return.
A drag smaller than 2x2 px in selection mode captures the window under the cursor rather than a region.
| File | Contents |
|---|---|
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 && make