Skip to content

Instantly share code, notes, and snippets.

@Amooti73
Created April 13, 2020 15:00
Show Gist options
  • Save Amooti73/e88f105009c48081472dec8089abaf99 to your computer and use it in GitHub Desktop.
Save Amooti73/e88f105009c48081472dec8089abaf99 to your computer and use it in GitHub Desktop.
#!/bin/bash
# Dependencies: tesseract-ocr imagemagick scrot xsel
SCR_IMG=`mktemp`
trap "rm $SCR_IMG*" EXIT
/usr/bin/scrot -s $SCR_IMG.png
/usr/bin/mogrify -modulate 100,0 -resize 400% $SCR_IMG.png #should increase detection rate
/usr/bin/tesseract $SCR_IMG.png $SCR_IMG &> /dev/null
cat $SCR_IMG.txt | /usr/bin/xsel -bi
exit
@Amooti73
Copy link
Author

This is not my own work, but from the above post. I have found it very useful and now adapted it for some other scripts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment