dotfiles/bin/ocr

21 lines
612 B
Plaintext
Raw Normal View History

#!/usr/bin/env bash
# A script that utilizes OCR for a screenshot and copies the text to the clipboard.
# Dependencies:
# * tesseract 4.1.1
# * leptonica-1.79.0
# * The Tesseract English data
# * Image libraries (e.g., `libgif`, `libwebp`)
2020-12-12 03:05:06 +00:00
# * ImageWorsener 1.3.3
# * xclip - version 0.13
# * maim - version 5.6.3
# It's a small script anyways so why not.
# I feel like this is one of the appropriate solutions especially that there is potential for erreneous feedback.
set -o pipefail
notify-send "Select a region for the OCR"
2020-12-12 03:05:06 +00:00
maim --select --hidecursor | imagew - -outfmt png -w x5 - | tesseract - stdout