dotfiles/bin/ocr
foo-dogsquared d3fadf8fe1 Finalize the setup for the dotfiles
The documentation for it has been updated, wal templates are also updated, and certain scripts has been revised to be easily understood.

This may be my stop for the whole year. I'm pretty content with this one.
2020-05-01 21:32:25 +08:00

20 lines
634 B
Bash

#!/usr/bin/env sh
# 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`)
# * 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"
maim -s | tesseract - stdout | xclip -in -selection clipboard && notify-send "Image content has been copied on the clipboard."