Files
SDG-DRIFT/Ax_Shell/scripts/ocr.sh
T
2026-06-03 21:26:54 +02:00

14 lines
488 B
Bash
Executable File

#!/usr/bin/env bash
# Captura con hyprshot (selección de región) y envía imagen RAW a stdout
ocr_text=$(hyprshot -m region -z -r -s | tesseract -l eng - - 2>/dev/null)
# Comprueba si Tesseract devolvió algo
if [[ -n "$ocr_text" ]]; then
# Copia el texto reconocido al portapapeles
echo -n "$ocr_text" | wl-copy
notify-send -a "Ax-Shell" "OCR Success" "Text Copied to Clipboard"
else
notify-send -a "Ax-Shell" "OCR Failed" "No text recognized or operation failed"
fi