

Show HN: I updated the Smackbook script for OS X Yosemite - dabockster
https://github.com/dabockster/Smackbook-Yosemite

======
dabockster
Hey guys!

Thanks for the comments on this small side project/homework procrastination of
mine. When I originally saw this back in 2006, I thought it was one of the
best tricks ever to do with a laptop computer. I was 13 at the time. Fast
forward about 8-9 years, add some CS and Perl education, and bam, I finally
know enough on how to update the script to save it from the black depths of
the Internet.

Took me a while to find an implementation that referenced enough to OS X
Spaces, but I'm glad I could revive the idea.

If I have the chance, I would love to write a clone of this and not have
AMStracker as a dependency. Or if someone else wants to, that's cool too. I
just don't know how long that AMStracker site will stay up.

------
pilif
Please correct me if I'm wrong (I probably am), but using this for anything
but a cool demo feels dangerous to me: You're relying on the input signal of
an emergency motion detector to park the harddrive heads as a device to do UI
interaction.

What I mean is: In order to switch spaces, you have to hit the machine hard
enough for the "uh oh - shock emergency" sensor to actually trigger. That
means that you have to hit the machine hard enough for it to think it has to
do something in order to prevent hardware damage.

What was meant as an emergency measure for rare emergencies now becomes
commonplace. Are you sure that a) the mechanism always works? and b) that the
emergency head parking doesn't put too much stress on the disk to wear it down
more quickly?

I'm basing this question on the fact that in the demo video there was one
instance where they didn't hit the device hard enough for the switch of spaces
to actually happen. That leads me to believe that the sensor isn't that
accurate and really only measures dangerous levels of activity.

But yeah: As a demo performed once or twice it's really cool and fun to watch.

~~~
geofft
You can get acceleration data that's well within the non-emergency situation
from Macs. This thing works on Chrome on my Mac (which is a little
disconcerting, to be honest):
[http://www.html5rocks.com/en/tutorials/device/orientation/de...](http://www.html5rocks.com/en/tutorials/device/orientation/deviceorientationsample.html)

~~~
Pirate-of-SV
I got a MBA (Mid 2011) + Chrome but I can't get it to work.

A friend asked me WTF I was doing and it felt like a April fools joke.

~~~
madeofpalk
Didn't work for me on my retina MBP either.

Wouldn't be surprised if our Mac notebooks, being SSD based, didn't have the
SMS

 _Edit:_ Apple says all Intel Mac notebooks have the SMS, but then goes on to
say that SSD notebooks don't use them [http://support.apple.com/en-
us/HT1935](http://support.apple.com/en-us/HT1935)

------
kecebongsoft
I wouldn't use this, but this is cool. At first I thought it was using
microphone to detect which side the smacking sound was coming from, but since
others have pointed out, I didn't know harddrive heads have such sensors and
can be accessed using programming language. It's probably suitable when you
want to have an emergency button to destroy/encrypt/close all super-
confidential information when someone's approaching and you don't have enough
time to type/click anything, just smack!.

~~~
dabockster
The sensor is in the system itself, not the drive.

------
bjz_
Oh, gotta love the SMS. There were several obscure apps that experimented with
it:

\- [http://uri.cat/software/LiquidMac/](http://uri.cat/software/LiquidMac/)

\- [http://uri.cat/software/Tunnel/](http://uri.cat/software/Tunnel/)

\-
[http://www.suitable.com/tools/seismac.html](http://www.suitable.com/tools/seismac.html)

\- [http://blog.isnoop.net/2006/05/20/macsaber-turn-your-mac-
int...](http://blog.isnoop.net/2006/05/20/macsaber-turn-your-mac-into-a-jedi-
weapon/)

Bonus video: MacSaber fighting!
[https://www.youtube.com/watch?v=qK4AonfnFaM](https://www.youtube.com/watch?v=qK4AonfnFaM)

------
genmon
Ha, neat! I remember using amstracker to jump forward in iTunes by bumping my
laptop. Literally the first time I'd encountered physical UIs, it felt so
natural. And now there's Wii and Kinect and Leap etc.

Ancient code:
[http://interconnected.org/home/more/2005/03/bumptunes.py](http://interconnected.org/home/more/2005/03/bumptunes.py)

And ancient write-up:
[http://interconnected.org/home/2005/03/04/apples_powerbook](http://interconnected.org/home/2005/03/04/apples_powerbook)

------
geofft
YESSS I remember seeing this in high school and I'd completely forgotten about
it. So glad to see it again.

Here's the original post courtesy of the Internet Archive:
[http://web.archive.org/web/20121221154722/http://blog.medall...](http://web.archive.org/web/20121221154722/http://blog.medallia.com/2006/05/smacbook_pro.html)

~~~
micampe
Very cool, I wrote the ThinkPad version at the time. I had forgotten about it,
there is a link to my post at the time in that page and I’m happy archive.org
exists
[http://web.archive.org/web/20070922232656/http://blog.micamp...](http://web.archive.org/web/20070922232656/http://blog.micampe.it/articles/2006/06/04/here-
comes-the-smackpad)

I was definitely not in high school at the time.

------
wingerlang
So what does it do?

~~~
tazjin
It uses the harddrive's motion sensor to figure out if the computer is being
smacked on one side, and then switches to the next virtual screen in the
opposite direction.

(that's what I gathered from the video at least)

~~~
wingerlang
This should be on the top of the readme, IMO.

~~~
dabockster
Agreed. I just updated the readme.

------
jevin
This is actually quite cool. Looks like all Macbooks around the 2012 era had
SMS: [http://support.apple.com/en-us/HT1935](http://support.apple.com/en-
us/HT1935)

------
josephpmay
The one time I wish my Mac had a HDD instead of SSD

~~~
dabockster
All Macbooks claim to have the accelerometer, so it should work. If not, the
sensitivity values are clearly marked in the script.

~~~
stoolpigeon
My Macbook pro retina does not have an accelerometer.

~~~
cstuder
The acceleromenter was built into the MacBooks in order to protect the hard
drives. I guess it makes sense that after moving to SSD the sensor has been
taken out.

~~~
stoolpigeon
Yeah - it makes sense to me. I wasn't sure but I tried a few apps that are
supposed to use it and looked for it in my system information and I didn't see
it. (I'm really new to using a mac)

