summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMitsuo Tokumori <[email protected]>2024-09-28 15:12:19 +0900
committerMitsuo Tokumori <[email protected]>2024-09-28 15:12:19 +0900
commit1163cd2e55e947874db656ce6857c929b0c32d39 (patch)
tree73ff78a73142e8269b954eecbeabc219e755b226
parente5cc87b1d9fd9e5564aa50d5b807346bb0d1b435 (diff)
downloaddotfiles-1163cd2e55e947874db656ce6857c929b0c32d39.tar.gz
dotfiles-1163cd2e55e947874db656ce6857c929b0c32d39.tar.bz2
dotfiles-1163cd2e55e947874db656ce6857c929b0c32d39.zip
Update screenshot_ocr.sh
Now image is saved into clipboard
-rwxr-xr-xpublic/.local/bin/screenshot_ocr.sh5
1 files changed, 4 insertions, 1 deletions
diff --git a/public/.local/bin/screenshot_ocr.sh b/public/.local/bin/screenshot_ocr.sh
index d88accf..012a2b7 100755
--- a/public/.local/bin/screenshot_ocr.sh
+++ b/public/.local/bin/screenshot_ocr.sh
@@ -22,7 +22,10 @@ test $? -ne 0 && exit
# Try to scan codes from the image
zbarimg $filename | xclip -selection "clipboard"
# Perform OCR and save to clipboard
-tesseract $tesseract_options $filename - | xclip -selection "clipboard"
+tesseract $tesseract_options $filename - | xclip -selection "clipboard" -r
+# Copy image into the clipbaord (useful to pasting directly into other apps)
+# To access previosly copied text use fcitx5 clip clipboard tool (<C-;>)
+xclip -selection clipboard -t image/png -i $filename
rm $filename
# TODO: clean japanese output. If text is 80% japanese characters, then it