On Tue, 2010-08-17 at 19:17 -0400, Albert Hopkins wrote:

> 
> This is a weird script.  It's a ruby script that creates a web server,
> but the web server listens for...
> 
> It runs a python script that uses python-xlib to listen for key presses,
> and when a key is pressed it uses curl to open the connection to the
> ruby script.. when the ruby script receives a request it plays a sound.
> 
> So really it's the Python script that's doing all the work... If you can
> just try downloading the python script[1] and replacing 'curl
> http://localhost:4567/key' with 'aplay myfile.wav'
> 
> [1]
> http://github.com/colszowka/linux-typewriter/blob/master/bin/keypress.py


Here is my edit of his Python script.  Basically the original author was
making the wrong Python call to call aplay and, instead of looking up
the documentation, he decided to create a ruby script that creates a web
server to he can connect to it and play audio files :S

Anyway this version seems to work for me.  I modified it a bit to play a
different file when the ENTER key is pressed and to mask aplay's output.

Again, I acquired the wav files from:
http://www.soundjay.com/typewriter-sounds.html

-a





Reply via email to