Couple suggestions:
key="$(waitforkey)"
Instead of putting it into a file and concatenating it.
Use { blah ; } instead of (blah) as it doesn't have to spawn a subshell (it's basically a unnamed function) so it's faster.
Actually you could probably combine it all in to one echo like:
echo -e "19 0\n18 0\n19 7" >
Use [[ blah ]] instead of [ blah ] as it's faster.
Instead of `seq 1 5` which has to spawn a subshell, it's faster when using small intervals to just do "1 2 3 4 5" (with no quotes)
|