shakebook pro for leopard – switch spaces with violence!
I was just goin around on the interblagosphere today and stumbled upon Erling Ellingsen’s smackbook pro. If you’ve never heard of this then you’re in for a shock. The basic idea behind what he has created is a way to switch virtual desktops simply by tapping the side of the laptop’s monitor.
I was immediately in love and wanted to play with it a bit but he was using DesktopManager to do the space switching. Since I’m running leopard on the laptop I figured that was a waste of time and I’d never actually use a 3′d party virtual desktop switching app… and so the journey began. I turned to my mortal enemy, applescript, to accomplish this. After some browsing and hacking I found that this simple code can send CONTROL-# keystrokes to get the job done:
tell application "System Events" tell process "Finder" keystroke "[SPACENUMBER]" using control down end tell end tell
If you toss that into osascript from the command line we can finally start to get somewhere. So the next step was to grab that sudden motion sensor app. Erling was using AMSTracker by Amit Singh so that seemed a good place to start. After that a quick ruby script tied the SMS dump to the applescript and a fun new project was born. It is a lotta bit rough around the edges and needs some sensitivity tuning, but it _does_ get the job done… just be a little rough*
I am definitely not responsible for any damage caused by using this script — it was a proof of concept hack.
Based off “SmackBook Pro”
This is not mine, but mine does essentially the same thing, only using native Leopard spaces… and ruby.
Where to get the script?
Running it is as simple as
$>AMSTracker -S -u0.01 | shakebook.rb then tap away (or shake if you want to be careful)