Skip to content

Instantly share code, notes, and snippets.

@Rudo2204
Created December 22, 2020 06:47
Show Gist options
  • Save Rudo2204/ce65b7f3549a95721100e26631c9302f to your computer and use it in GitHub Desktop.
Save Rudo2204/ce65b7f3549a95721100e26631c9302f to your computer and use it in GitHub Desktop.
scrot into tesseract, copy to clipboard
#!/bin/bash
# Dependencies: tesseract-ocr scrot
#select tesseract_lang in jpn jpn_vert ;do break;done
# Quick language menu, add more if you need other languages.
SCR_IMG=`mktemp`
trap "rm $SCR_IMG*" EXIT
scrot -s $SCR_IMG.png -q 100
tesseract -l jpn_vert $SCR_IMG.png $SCR_IMG &> /dev/null
sed '$ s/.$//' $SCR_IMG.txt | xclip -sel clip
exit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment