Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Show HN: I updated the Smackbook script for OS X Yosemite (github.com/dabockster)
65 points by dabockster on Nov 5, 2014 | hide | past | favorite | 35 comments


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.


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.


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...


Bookmarked. That thing is cool.

And yes, the accelerometer exists to detect movement consistent with the shock of hitting the ground. For other purposes, the movement is way too small to trigger the mechanism.


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.


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


Hm. http://caniuse.com/deviceorientation links to https://www.chromestatus.com/features/5874690627207168 , which claims it's been on by default since Chrome 7. The model list in http://crbug.com/44654 lists only MacBook Pros, though -- I have a mid-2012 MBP that originally shipped with a spinning disk. (It's possible that the Airs, which only ship with SSDs, don't have an accelerometer?)


I had this work on my late 2008 macbook pro a long while ago.


>a little disconcerting, to be honest

Yep, this is yet another vector to assist in de-anonymization of people - especially those using machines that often stay at a certain, specific x-y axis tilt on some desktops, etc.


Haha... I have to wonder why something so noncontroversial got downvoted without mentioning why I'm "wrong" about this.

I guess a knee-jerk, lizard brain fear response? Haha... Oh boy, I bet they'd really downvote me if I mentioned canvas fingerprinting. :P


>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.

Who said it has to trigger (the parking mode)?

Isn't it more probable that it just reads the current value from the sensor (which monitors movement constantly)...

It's not like you have to have the same threshold for parking the heads and for hitting the machine.

>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.

That's quite premature to deduce from one instance though. But even so, if the sensor works OK and does what it should, there should be no problem.


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!.


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


What if someone accidentally bumps into your desk.



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

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


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...


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...

I was definitely not in high school at the time.


The guy's blog post is still up, but the original script is EXTREMELY hard to find. I found a version that was updated for Spaces in Leopard, and updated that to Yosemite. It just needed some tweaks in a few places.


So what does it do?


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)


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


Agreed. I just updated the readme.



Odd, first time I pressed this it was a video about some SSD.


Fixed that. I got it uploaded at midnight after switching between this and my Python homework.


YouTube has these weirdnesses lately!


Change to different desktop by tapping on the bottom right/left of your screen.


That's Shadowbook. Like Smackbook, but it uses the Macbook's ambient light sensor instead of the accelerometer. Haven't found that one yet.


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


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


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


My Macbook pro retina does not have an accelerometer.


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.


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)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: