| Home | Notes | Github |
|---|
Written: 24-May-2021
Inspired by macOCR(and in particular the beautiful gif), but I wanted, no needed it for linux.
My thoughts were to use:
flameshot method
of doing this, but it made more sense to use…import from ImageMagick for the
screenshot part.
import is a handy function. This is how to get it to
print to stdout (in .png format):
import png:-
The following command takes an image image.png and
outputs text to stdout.
tesseract tess_test.png - quiet
This can then be put to the clipboard using:
xclip -sel clip
To combine the lot:
import png:- | tesseract - - quiet | xclip -sel clip
The next step (if you want) is to bind it to a shortcut. My choice is
Ctl + T for text 😁Ctl + y2.
After working all of this out someone had commented on the HN thread with this exact solution to my problem. So not wholly unique, but nice to see I’m barking up the right tree!