feat(capture): OCR region to clipboard (LATER item)
All checks were successful
Check / eval (push) Successful in 3m6s

Tools › Capture gains "OCR region → clipboard", self-gated on
tesseract: slurp the region (Esc cancels silently, the recording.nix
pattern), grim it, tesseract stdin→stdout, wl-copy. Whitespace-only
recognition toasts "No text recognized" instead of clobbering the
clipboard; success toasts the word count. tesseract ships English-only
through the menu's package set — the unscoped wrapper pulls every
language's traineddata, a real cost on a compile-from-source distro;
overriding with more languages is documented at the package line.

Verified: V0; V1 — template-home builds with the gated row + case and
menu bash -n; functional — the profile's own tesseract read a rendered
test image back verbatim, proving the OCR half of the pipe. The
grim/slurp half needs a session → HARDWARE-QUEUE.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Bernardo Magri
2026-07-05 21:29:08 +01:00
parent 3e49481d46
commit 4ad564bd80
4 changed files with 40 additions and 3 deletions

View File

@@ -234,9 +234,6 @@ them as composable commands, not dead ends.
- **Night-light geo mode**: lat/long auto sunset/sunrise (means wlsunset).
- **Per-theme icon overrides** / more icon packs (ROADMAP § Icon themes).
- **MIPI/IPU software-ISP camera** support (no-UVC machines).
- **OCR screenshot-to-text**: a Capture entry (grim region → tesseract
→ clipboard) — recording (#12, shipped 2026-07-04) already reshaped
the submenu, so this is now a two-row addition.
- **Doctor Waybar warning**: a self-gating bar indicator fed by
`nomarchy-doctor` (shipped 2026-07-04) — appears only when the sheet
has a ✖; click opens the sheet.

View File

@@ -167,6 +167,11 @@ QA machine), the **T14s** (webcam case).
(tooltips, fastfetch labels) is visible on summer-day +
flexoki-light, kanagawa floats are lighter than the bg (upstream
sumiInk4). Anything that reads worse than before → reopen 28b.
- [ ] **OCR region (LATER item)** — Tools Capture "OCR region →
clipboard": select a region with visible text → toast reports
the word count and `wl-paste` yields the text; Esc in slurp
cancels silently; a text-free region toasts "No text recognized"
without clobbering the clipboard.
- [ ] **Look & Feel submenu (item 19)** — root menu: "Look & Feel"
(replacing Theme, root still six rows) → Theme grid opens, Next
wallpaper cycles instantly, Night light toggles (and is GONE

View File

@@ -17,6 +17,26 @@ Template:
---
## 2026-07-05 — OCR screenshot-to-text (iteration #41, LATER item)
- **Task:** LATER OCR (NEXT is fully human/event-gated, so LATER is
in play per LOOP.md). Bullet deleted.
- **Did:** Capture "OCR region → clipboard" (self-gated on
tesseract): slurp (Esc = silent cancel, the recording pattern) →
grim → tesseract stdin/stdout → wl-copy, whitespace-only results
toast instead of clobbering the clipboard; success toasts the word
count. tesseract ships eng-only via rofi.nix home.packages
(override documented — unscoped it drags every language's
traineddata, real cost on a compile-from-source distro).
- **Verified:** V0; V1 — template-home builds, menu bash -n, gated
row + case present; FUNCTIONAL — the profile's own tesseract read a
rendered test image back verbatim ("Nomarchy OCR smoke test 42"),
so the OCR half of the pipe is proven; grim/slurp half needs a
session → V3 queued.
- **Pending:** V3.
- **Next suggestion:** LATER: doctor Waybar warning (self-gating bar
indicator fed by nomarchy-doctor) or auto-timezone tooltip; both
small.
## 2026-07-05 — Look & Feel menu category (iteration #40, item 19)
- **Task:** BACKLOG NEXT#19 — its ≥3-entries gate is met (Theme, Next
wallpaper, Night light). Item deleted.