clipboard

Sometimes I need to snip text that can't just be copy pasted (e.g. in an image). For this, I use tesseract, which depends on tessdata for language support. See Gentoo Wiki: Localization ⇗.

/etc/portage/package.use/tesseract
app-text/tesseract jpeg tiff webp png float32
media-libs/leptonica tiff png webp jpeg       # deps
app-text/tessdata_fast L10N: ja en zh         # lang

As for actually using tesseract ocr, it's like screenshot ⟹-ish, basically.

grim -g "$(slurp)" - \
  | tesseract stdin stdout -l eng+jpn \
  | wl-copy

Of course, if you haven't already, also install app-misc/cliphist for clipboard history.