Window Selection, Image Capture, and OCR
2019-05-22 23:50:00 +0000 - Written by Carl Burks
I made a little project which leverages some existing Linux tools for capturing images:
From the README I wrote:
This is a set of scripts to help snagging images
if you don’t have this installed here:
you will have a bad time
This gets the mouse location.
used for capturing images
What the scripts do?
makes a ~/.imageRobber/settings.json copies scripts to /usr/bin/
Reads a JSON key from file. It only works on a flat dictionary.
jread <file> <key>
Writes a JSON key to file. It only works on a flat dictionary.
jwrite <file> <key> <value>
Saves the mouse x/y in settings.json
store_mouse_location <position (0|1)>
import_expression_builder <x0> <x1> <y0> <y1>
gets the expression for import
captures a subset of the screen from settings
import -window root -crop <expression from x0 x1 y0 y1 from settings> <date stamp>.<extension from settings>"
How to use
keyboard bind “store_mouse_location 0” to a key command keyboard bind “store_mouse_location 1” to a key command keyboard bind “capture_screen_shot” to a key command
Enable OCR on output keyboard bind “jwrite $HOME/.imageRobber/settings.json “convert to text” 1
Disable OCR on output keyboard bind “jwrite $HOME/.imageRobber/settings.json “convert to text” 0