summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorr1w1s1 <r1w1s1@fastmail.com>2025-12-14 22:42:29 -0300
committerr1w1s1 <r1w1s1@fastmail.com>2025-12-14 22:42:29 -0300
commit9d5460c1c69ffd14350a1016d98a0b1c20e1dd7d (patch)
tree81478d4bfc9b152b4c259de85a6cb7eb8d83c38e
parentb8e0d8add81f9d71cfb62c0ff6f2e631a90b6a45 (diff)
README: clarify stdout output and examples
-rw-r--r--README.md55
1 files changed, 47 insertions, 8 deletions
diff --git a/README.md b/README.md
index d66734c..2671fdd 100644
--- a/README.md
+++ b/README.md
@@ -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'"`