-
-
Save bryceml/4ba62bb9f8e087d3a5f7c12200166709 to your computer and use it in GitHub Desktop.
script for selecting a part of the screen for optical character recognition and putting it on the clipboard
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Dependencies: tesseract-ocr imagemagick scrot xsel | |
SCR_IMG=`mktemp` | |
trap "rm $SCR_IMG*" EXIT | |
scrot -s $SCR_IMG.png | |
mogrify -modulate 100,0 -resize 400% $SCR_IMG.png #should increase detection rate | |
tesseract $SCR_IMG.png $SCR_IMG &> /dev/null | |
cat $SCR_IMG.txt | xsel -bi | |
exit |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment