Woah, I never seen something like this done with bash and command line utilities. Thanks for sharing, made me find xdotool which is exactly what I neede to replace SikuliX. I can't comment on the project since I didn't test it but wow, only this example https://bitbucket.org/Pirates-of-Silicon-Hills/voightkampff/... made me think why didn't OP use a scripting language and went with Bash? (Python?)
Don't get me wrong, the Bash level is strong with this one :)