-m Add OCR to wayland-screenshot.sh
This commit is contained in:
parent
5c497e5390
commit
cf73e8a8ed
@ -4,6 +4,7 @@ local resp="$(fuzzel --index -d <<'EOF'
|
||||
Whole screen
|
||||
Current window
|
||||
Selected area
|
||||
Copy text with OCR
|
||||
EOF
|
||||
)"
|
||||
|
||||
@ -25,4 +26,12 @@ case "${resp}" in
|
||||
[[ "${area}" == 'selection cancelled' ]] ||
|
||||
grim -g "${area}" "${outfile}"
|
||||
;;
|
||||
3)
|
||||
local area="$(slurp 2>&1)"
|
||||
if [[ "${area}" != 'selection cancelled' ]]; then
|
||||
local text="$(grim -g "${area}" -t png /dev/fd/1 |
|
||||
tesseract stdin stdout -l eng 2>/dev/null)"
|
||||
wl-copy "${text}"
|
||||
notify-send -t 5000 "Coppied Text" "Coppied ${#text} characters"
|
||||
fi
|
||||
esac
|
||||
|
Loading…
Reference in New Issue
Block a user