Created
February 1, 2025 09:51
-
-
Save rcky844/286a8b424e8233468829816a6adb69b7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
TMPFILE=$(mktemp) | |
trap 'rm -f "$TMPFILE"' EXIT | |
spectacle -r -o $TMPFILE -b -n 2>/dev/null | |
if [ -f "$TMPFILE" ]; then | |
export OMP_THREAD_LIMIT=1 | |
if [ "$XDG_SESSION_TYPE" = "x11" ]; then | |
tesseract $TMPFILE - --oem 1 | xclip -selection clipboard | |
fi | |
if [ "$XDG_SESSION_TYPE" = "wayland" ]; then | |
tesseract $TMPFILE - --oem 1 | wl-copy | |
fi | |
kdialog --passivepopup "OCR finished" 7 --title "OCR" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment