The Smackbook

If you have a MacBook or PowerBook with the embedded motion sensor, you have to see Erling Ellingsen's SmackBook. Desktop paging with a tap of the hand; so very cool. I normally see things like this and appreciate the inventive nature of the author, but rarely do I bother to actually implement them. This was an exception. If you read the comments you'll find patched binaries of Desktop Manager (a great app that

If you have a MacBook or PowerBook with the embedded motion sensor, you have to see Erling Ellingsen's SmackBook. Desktop paging with a tap of the hand; so very cool. I normally see things like this and appreciate the inventive nature of the author, but rarely do I bother to actually implement them. This was an exception.

If you read the comments you'll find patched binaries of Desktop Manager (a great app that I've been using for eons) and some hints on getting everything working. In my case, I'm running 1.67Ghz 15" PowerBook G4 and I had to do some fiddling with the thresholds after building the patched Desktop Pager. I'm still working on getting the settings just right, but if you're having trouble, try this modified smack.pl:


#!/usr/bin/perl

use strict;

my $stable;

open F,"./AMSTracker -s -u0.01 |";
while() {
my @a = /(-?\d+)/g;
print, next if @a != 3;

# we get a signed short written as two unsigned bytes
my $x = $a[0];

if(abs($x) < 10) {
$stable++;
}

if(abs($x) > 15 && $stable > 15) {
$stable = 0;
my $foo = $x < 0 ? 'Prev' : 'Next';
system "./notify SwitchTo${foo}Workspace\n";
}
}

It's a bit trying to find the line between breaking your screen hinges to shift desktops and having them switch too easily. The easiest way to gauge what's happening is to run AMSTracker -s -u0.01 > test and tap each side of the screen at an appropriate level, then take a look at the resulting values. Nice work, Erling!

From CIO: 8 Free Online Courses to Grow Your Tech Skills
Join the discussion
Be the first to comment on this article. Our Commenting Policies