Warning: call_user_func() [function.call-user-func]: First argument is expected to be a valid callback in /home/robzbd/sites/blog.ubrio.us/wp-content/plugins/akismet/widget.php on line 126
shakebook pro for leopard – switch spaces with violence!

shakebook pro for leopard – switch spaces with violence!

Update!
Switch spaces using your Apple Remote! (Or view the project on GitHub)

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)

Revisions will probably be made to sensitize it once I have time to mess around with it — if you come up with anything shoot me back a comment :)


Comments

No comments yet.

Add Yours

  • Author Avatar

    YOU


Comment Arrow




About Author

Rob Hurring

Ruby, Rails, PHP, bash... oh my!