xnap is a minimal screenshot utility for X11.
It captures screen contents and writes a raw PPM (P6) image to standard output. xnap does not save files by itself and does not perform image conversion.
make sudo make install
- Xlib (required)
- Xinerama (optional, for multi-monitor support)
xnap always writes image data to stdout. Redirect the output to a file or pipe it to another program for conversion or storage.
Examples:
xnap > image.ppm
xnap -f > fullscreen.ppm
xnap -s 0 > screen0.ppm
xnap | convert ppm:- image.png
Using sxwm:
bind : mod + shift + s : "bash -c 'xnap | pnmtopng | tee ~/Pictures/screenshots/$(date +%Y-%m-%d_%H-%M).png | xclip -selection clipboard -t image/png'"
xnap follows the Unix philosophy:
- do one thing
- do it simply
- leave storage and conversion to other tools
Enjoy!