add script

master
histausse 3 years ago
commit 8221e5a533
Signed by: histausse
GPG Key ID: 67486F107F62E9E9

@ -0,0 +1,12 @@
# Screen to text
Take a screen shot, run OCR on it, and put the result to the clipboard
Dependencies:
- spectacle
- tesseract
- xclip (for X, wayland might need more configuration)
```
sudo pacman -S spectacle tesseract tesseract-data-fra tesseract-data-eng tesseract-data-osd xclip
```

@ -0,0 +1,16 @@
#!/bin/sh
# Take a screen shot, run OCR on it, and put the result to the clipboard
#
# Dependencies:
# - spectacle
# - tesseract
# - xclip (for X, wayland might need more configuration)
#
# `sudo pacman -S spectacle tesseract tesseract-data-fra tesseract-data-eng tesseract-data-osd xclip`
TESS_LANG='fra+eng+osd'
file='/tmp/img_'`head --bytes=20 /dev/urandom | md5sum | head --bytes=20`'.png'
/sbin/spectacle --region --background --nonotify --output "$file"
/sbin/tesseract "$file" - -l "$TESS_LANG" | /sbin/xclip -in -selection clipboard
Loading…
Cancel
Save