From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1OlWBn-0003xc-LI for garchives@archives.gentoo.org; Wed, 18 Aug 2010 00:07:33 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 76A52E09C3 for ; Wed, 18 Aug 2010 00:07:30 +0000 (UTC) Received: from out1.smtp.messagingengine.com (out1.smtp.messagingengine.com [66.111.4.25]) by pigeon.gentoo.org (Postfix) with ESMTP id B06E7E097D for ; Tue, 17 Aug 2010 23:41:58 +0000 (UTC) Received: from compute3.internal (compute3.internal [10.202.2.43]) by gateway1.messagingengine.com (Postfix) with ESMTP id 92AB92F7 for ; Tue, 17 Aug 2010 19:41:58 -0400 (EDT) Received: from frontend1.messagingengine.com ([10.202.2.160]) by compute3.internal (MEProxy); Tue, 17 Aug 2010 19:41:58 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=messagingengine.com; h=subject:from:to:in-reply-to:references:content-type:date:message-id:mime-version:content-transfer-encoding; s=smtpout; bh=6AjyvkzmIsm6mDcTVFwdjWOVYjs=; b=GBaY70zYE29wdmU1EgYWb4RofM688g086yJN50Wb5vTOTblwiwdXZRxV4tN8z5L7Kq4VFYyeH7fLky2fRMEsDvR2PaQBs4yBZi4i9WVlo8I5zo1KXRrpQd7JoPr1sHj+XDzOWOuBVXbD03eXmIsTO0gJEYZSuX6YTsMyy174+EU= X-Sasl-enc: 4kntwzvwo+dcp82KeUd5U0lTF3VTtByq+mspsG/V17xV 1282088518 Received: from [192.168.31.28] (cpe-069-134-182-167.nc.res.rr.com [69.134.182.167]) by www.fastmail.fm (Postfix) with ESMTPSA id 54020407121 for ; Tue, 17 Aug 2010 19:41:58 -0400 (EDT) Subject: Re: [gentoo-user] Typewriter sound From: Albert Hopkins To: gentoo-user@lists.gentoo.org In-Reply-To: <1282087043.456104.6.camel@paska> References: <20100817172005.GA5110@solfire> <1282087043.456104.6.camel@paska> Content-Type: text/plain; charset="UTF-8" Date: Tue, 17 Aug 2010 19:41:57 -0400 Message-ID: <1282088517.456104.20.camel@paska> Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-user@lists.gentoo.org Reply-to: gentoo-user@lists.gentoo.org Mime-Version: 1.0 X-Mailer: Evolution 2.30.2 Content-Transfer-Encoding: 7bit X-Archives-Salt: ee27b056-e772-4c51-8103-4c4286c4b11a X-Archives-Hash: 695889209ae7cd7f18a630d6cd5df15a 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