Skip to content

Instantly share code, notes, and snippets.

@enisozgen
Last active February 13, 2016 19:31
Show Gist options
  • Save enisozgen/fcd91407ecafc12fc495 to your computer and use it in GitHub Desktop.
Save enisozgen/fcd91407ecafc12fc495 to your computer and use it in GitHub Desktop.
Quick script that convert image to text in GNOME
#!/bin/bash
# Small script that works on GNOME as OCR to text
# Install
# sudo apt-get install tesseract-ocr
# sudo apt-get install xsel
# Usage
# Bound shortcut(Ctrl-Alt-Z) from GNOME settings
# Press (Ctrl-Alt-Z)
# Select area
# Paste to editor
cd /tmp/
rm temp.png
gnome-screenshot -a --file=temp.png
tesseract temp.png output ; cat output.txt | xsel -bi ; rm output.txt
exit 1
# Known bugs
# Sometimes it's necessary to press (Ctrl-Alt-Z) few times
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment