flameshot gui --raw | \
  tesseract stdin stdout | \
  xclip -in -selection clipboard
  • flameshot :: Powerful yet simple to use screenshot software
  • tesseract :: Tesseract Open Source OCR Engine
  • xclip :: Command line interface to the X11 clipboard

The flameshot gui launches a GUI that allows you to select a region of the screen, and then press enter. The image output is piped to tesseract which does the OCR and in turn pipes it to xclip which copies it to the clipboard.

I think this is the first time I’ve seen a GUI tool that follows the Unix Philosophy.