Prechádzať zdrojové kódy

dev: automated commit - 2025-10-10 18:38:54

Mariano Z. 4 mesiacov pred
rodič
commit
b2e57bf792
1 zmenil súbory, kde vykonal 20 pridanie a 0 odobranie
  1. 20 0
      zsh/.config/zsh/functions.zsh

+ 20 - 0
zsh/.config/zsh/functions.zsh

@@ -815,3 +815,23 @@ function nas() {
   rclone mount --vfs-cache-mode writes --dir-cache-time 5s --no-check-certificate --allow-other nas: /home/mzunino/nas
 }
 
+
+
+function ocr(){
+  grim -g "$(slurp)" - \
+    | magick - -colorspace gray -negate -brightness-contrast 15x40 -sharpen 0x2 -threshold 60% - \
+    | tesseract stdin stdout -l eng+equ --psm 6 --oem 3 \
+    -c preserve_interword_spaces=1 \
+    -c tessedit_char_blacklist='‘’”“”´`–—•' \
+    | sed -E '
+  s/[“”]/"/g;
+  s/[‘’]/"/g;
+  s/’/'"'"'/g;
+  s/[éèê]/8/g;
+  s/í/i/g;
+  s/—/-/g;
+  s/“/"/g;
+  ' \
+    | wl-copy
+  notify-send "✅ OCR copied to clipboard"
+}