From 5639219d9f03dc30c46f227960268440ddd2d10b Mon Sep 17 00:00:00 2001 From: funman300 Date: Tue, 28 Apr 2026 11:22:51 -0700 Subject: [PATCH] docs: add interactive screenshot design spec Co-Authored-By: Claude Sonnet 4.6 --- ...026-04-28-screenshot-interactive-design.md | 77 +++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 docs/superpowers/specs/2026-04-28-screenshot-interactive-design.md diff --git a/docs/superpowers/specs/2026-04-28-screenshot-interactive-design.md b/docs/superpowers/specs/2026-04-28-screenshot-interactive-design.md new file mode 100644 index 0000000..46df1dc --- /dev/null +++ b/docs/superpowers/specs/2026-04-28-screenshot-interactive-design.md @@ -0,0 +1,77 @@ +# Interactive Screenshot Script Design + +**Date:** 2026-04-28 +**Status:** Approved + +## Summary + +Replace the current minimal screenshot script with an interactive post-capture flow: a mako notification confirms the capture and offers an "Actions" button; clicking it opens a wofi dmenu with five options. Dismissing the notification requires no further interaction. + +## Current Behaviour + +```bash +FILE=~/Pictures/screenshot-$(date +%s).png +grim -g "$(slurp)" "$FILE" +wl-copy < "$FILE" +``` + +Captures a region, saves to `~/Pictures/`, copies to clipboard. No feedback, no post-capture options. + +## Flow + +``` +slurp (region select) + └─ cancelled (exit ≠ 0)? → exit silently +grim → ~/Pictures/screenshot-.png +wl-copy → copy image bytes to clipboard +notify-send --wait + title: "Screenshot captured" + body: "Saved · Copied to clipboard" + icon: $FILE (mako shows thumbnail) + action: "actions:Actions" + timeout: 10 000 ms + └─ dismissed / timed out → done + └─ "Actions" clicked → wofi --dmenu --prompt "Screenshot" + ├─ Annotate with swappy (default, top) + ├─ Annotate with satty + ├─ Open in imv + ├─ Copy path + └─ Delete +``` + +## Actions + +| Choice | Command | Follow-up | +|---|---|---| +| Annotate with swappy | `swappy -f "$FILE" &` | swappy handles its own save | +| Annotate with satty | `satty --filename "$FILE" &` | satty handles its own save | +| Open in imv | `imv "$FILE" &` | none | +| Copy path | `printf '%s' "$FILE" \| wl-copy` | notification: "Path copied" | +| Delete | `rm "$FILE"` | notification: "Screenshot deleted" | + +Annotation tools are launched in background so the script does not block waiting for them. + +## Edge Cases + +- **slurp cancelled:** `grim` exits non-zero; script checks `$?` and exits cleanly with no notification or file. +- **No selection made:** same as above — slurp exits non-zero if the user escapes. +- **wofi dismissed (Escape):** no action taken; file and clipboard copy are preserved. +- **Delete:** immediate, no undo. A confirmation notification fires so the user knows it happened. + +## Files Changed + +- `scripts/screenshot.sh` — rewrite +- `packages.txt` — add `satty`, `swappy` (already installed manually) + +## Tools Used + +| Tool | Purpose | +|---|---| +| `grim` | screen capture | +| `slurp` | region selection | +| `wl-copy` | clipboard | +| `notify-send` | notification (mako daemon) | +| `wofi --dmenu` | action picker | +| `swappy` | annotation (default) | +| `satty` | annotation (alternative) | +| `imv` | image viewer |