script läuft nicht richtig
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 | #!/bin/bash # Dependencies: tesseract-ocr, imagemagick, (grim, slurp[Sway]), spectacle[KDE], gnome-screenshot[GNOME], wl-clipboard, libnotify-bin # Add more if you need other languages. Example: eng+ita tesseract_lang=eng SCR_IMG=$(mktemp) notify() { notify-send "OCR Script" "$1" } take_screenshot() { case "$XDG_CURRENT_DESKTOP" in KDE) spectacle --region --background --nonotify --output "$SCR_IMG" ;; GNOME) gnome-screenshot -a -f "$SCR_IMG" ;; *) grim -g "$(slurp)" "$SCR_IMG" ;; esac } trap 'rm -f "$SCR_IMG"*' EXIT take_screenshot notify "Processing image for text extraction..." # Enhance the image for better OCR mogrify -modulate 100,0 -resize 400% "$SCR_IMG" # Performs the OCR on the screenshot tesseract "$SCR_IMG" "$SCR_IMG" -l "$tesseract_lang" &> /dev/null # Copy OCR result to clipboard wl-copy < "${SCR_IMG}.txt" notify "Text successfully copied to clipboard." # https://gist.github.com/mnofresno/25d0cc6a45aa8644596705c78382304e # https://gist.github.com/mnofresno/25d0cc6a45aa8644596705c78382304e?permalink_comment_id=5094040 |
aaa@aaa-System-Product-Name:/bin/lens$ ./lens compositor doesn't support zwlr_layer_shell_v1 invalid geometry mogrify-im6.q16: no decode delegate for this image format `YZRXCOQZVJ' @ error/constitute.c/ReadImage/580. aaa@aaa-System-Product-Name:/bin/lens$
Moderiert von rklm:
Ins passende Forum