diff --git a/projects/scripts/ocr.sh b/projects/scripts/ocr.sh index 2e9137e..758816e 100755 --- a/projects/scripts/ocr.sh +++ b/projects/scripts/ocr.sh @@ -1,17 +1,9 @@ #!/bin/bash set -Eeuo pipefail -# RES="$(slurp | grim -g - - | gazou | sed '1d;$d')" -# # Truncate RES for display if it's longer than 100 characters -# DISPLAY_RES="${RES:0:100}" -# if [ ${#RES} -gt 100 ]; then -# DISPLAY_RES="${DISPLAY_RES}..." -# fi -# notify-send "GAZOU" "Text: $DISPLAY_RES" -# echo "$RES" | wl-copy - -# grim -g "$(slurp)" /tmp/ocr.png || exit 1 -# slurp | grim -g - /tmp/ocr/ocr.png || exit 1 -owocr -r clipboard -w clipboard -of text -n || exit 1 +if ! pgrep -af owocr; then + notify-send "ocr.sh" "Starting owocr daemon..." + owocr -e meikiocr -r clipboard -w clipboard -l ja -n &>/dev/null & +fi slurp | grim -g - | wl-copy notify-send "ocr.sh" "Text: $DISPLAY_RES"