(no title)
grimgrin | 13 days ago
#!/usr/bin/env bash
# requires: tesseract-ocr imagemagick maim xsel
IMG=$(mktemp)
trap "rm $IMG*" EXIT
# --nodrag means click 2x
maim -s --nodrag --quality=10 $IMG.png
# should increase detection rate
mogrify -modulate 100,0 -resize 400% $IMG.png
tesseract $IMG.png $IMG &>/dev/null
cat $IMG.txt | xsel -bi
notify-send "Text copied" "$(cat $IMG.txt)"
exit
No comments yet.