This is a quick OCR hotkey — press Super+Shift+O → select any text on screen → the text is automatically copied to your clipboard (ready to paste).
It's a very common lightweight setup in Hyprland/Sway setups for copying text from images, videos, PDFs, or anything that isn't selectable normally.
keybind.conf
bind = $mainMod+Shift, O, exec, grim -g "$(slurp)" /tmp/ocr.png && tesseract -l eng /tmp/ocr.png - | wl-copy && rm /tmp/ocr.pngAction (when you press that hotkey):
- grim -g "$(slurp)" /tmp/ocr.png
- slurp lets you select a region on the screen with your mouse (it shows a crosshair/selection box).
- grim takes a screenshot of exactly that selected region and saves it temporarily as /tmp/ocr.png.
- tesseract -l eng /tmp/ocr.png -
- Runs Tesseract OCR (Optical Character Recognition) on the screenshot.
- -l eng → uses the English language model.
- The final - tells tesseract to output the recognized text to stdout (instead of a file).
- | wl-copy
- Pipes the extracted text directly into wl-copy, which copies it to your Wayland clipboard.
- After this, you can paste the text anywhere (Ctrl+V) as if you had typed it.
- && rm /tmp/ocr.png
- Cleans up by deleting the temporary screenshot file.