4 ms·
This looks like a nice app. I was looking for something like this a while back until I noticed that there are "one" liners that can you can setup for a hotkey:
by rjzzleep 4y ago
This looks like a nice app. I was looking for something like this a while back until I noticed that there are "one" liners that can you can setup for a hotkey:
#!/usr/bin/env bash
langs=(eng ara fas chi_sim chi_tra deu ell fin heb hun jpn kor nld rus tur)
lang=$(printf '%s\n' "${langs[@]}" | dmenu "$@")
maim -us | tesseract --dpi 145 -l eng+${lang} - - | xsel -bi
- tmerse 4y agoNice! Didn't know about maim. This looks better than what I currently use (found it somewhere on the internet). #!/bin/bash SRC_IMG=$(mktemp -u /tmp/ocr_XXXXXXXXX.png) scrot --select "$SRC_IMG" -q 100 mogrify -modulate 100,0 -resize 400% "$SRC_IMG" tesseract "$SRC_IMG" "$SRC_IMG" &> /dev/null OCR_RESULT=$(cat "$SRC_IMG.txt") echo "$OCR_RESULT" notify-send "$OCR_RESULT" xsel -bi < "$SRC_IMG.txt"
- ever1337 4y agoyeah, i have a script almost identical to this that i've been using with i3 for a long time
- ducktective 4y agoI wonder if it's possible to auto-detect the language. Meaning, instead of the priority list, it finds out the most probable language a script belongs to in the first sweep.
- tjoff 4y agoNice, that is great! I adapted this to work for me on wayland (sway): grim -g "$(slurp)" - | tesseract --dpi 145 -l eng+${lang} - - | wl-copy Using grim to take a screenshot, slurp to mark a region on your screen and wl-copy to copy to clipboard.