2020-03-26 18:52:38 +00:00
|
|
|
#!/usr/bin/env sh
|
2020-03-25 16:41:57 +00:00
|
|
|
|
2020-05-01 13:32:25 +00:00
|
|
|
# A script that utilizes OCR for a screenshot and copies the text to the clipboard.
|
2020-03-25 16:41:57 +00:00
|
|
|
|
2020-05-01 13:32:25 +00:00
|
|
|
# Dependencies:
|
2020-03-25 16:41:57 +00:00
|
|
|
# * tesseract 4.1.1
|
|
|
|
# * leptonica-1.79.0
|
2020-05-01 13:32:25 +00:00
|
|
|
# * The Tesseract English data
|
2020-03-25 16:41:57 +00:00
|
|
|
# * Image libraries (e.g., `libgif`, `libwebp`)
|
|
|
|
# * xclip - version 0.13
|
2020-05-01 13:32:25 +00:00
|
|
|
# * maim - version 5.6.3
|
2020-03-25 16:41:57 +00:00
|
|
|
|
2020-05-01 13:32:25 +00:00
|
|
|
# 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
|
2020-03-25 16:41:57 +00:00
|
|
|
|
2020-05-01 13:32:25 +00:00
|
|
|
notify-send "Select a region for the OCR"
|
2020-06-02 14:53:56 +00:00
|
|
|
maim --select --hidecursor | tesseract - stdout
|
2020-03-25 16:41:57 +00:00
|
|
|
|