diff options
| -rw-r--r-- | README.md | 55 |
1 files changed, 47 insertions, 8 deletions
@@ -1,13 +1,52 @@ # xnap -xnap is a minimalistic screenshot utility for X. -just `make install` +xnap is a minimal screenshot utility for X11. -you **need** `Xlib` and can use `Xinerama` optionally. -xnap is minimal and just outputs the image contents (PPM format) to the stdout. -please use a tool to collect that info and store / convert it to whatever you like. +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. -enjoy! +## Building and installing + +make +sudo make install + +## Dependencies + +- Xlib (required) +- Xinerama (optional, for multi-monitor support) + +## Usage + +xnap always writes image data to stdout. Redirect the output to a file or +pipe it to another program for conversion or storage. + +Examples: + +# Select a region and save as PPM +xnap > image.ppm + +# Capture the full screen +xnap -f > fullscreen.ppm + +# Capture screen 0 (Xinerama) +xnap -s 0 > screen0.ppm + +# Convert to PNG using ImageMagick +xnap | convert ppm:- image.png + +## Example key binding + +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'" + +## Philosophy + +xnap follows the Unix philosophy: +- do one thing +- do it simply +- leave storage and conversion to other tools + +Enjoy! -> example usage -> 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'"` |
