Medallia Blog

SmackBook Pro

By Erling Ellingsen on May 22, 2006
Updates below the fold

Ideal coding environment I usually keep two 20" screens side by side on my desk, so I can code on one and test on the other. I find I can work much faster if I can just make a change in Eclipse, and by the time I turn my head to the other screen, the tests have already run. My new laptop, however, has a 15" screen, which feels a bit cramped when I'm working away from the office. I've been using the fancy Desktop Manager by Richard Wareham, which is a very nice utility to let you keep several virtual desktops, and change between them easily.

Of course, if you're using something like Emacs or Butler, all your keys will be taken already, so you'll need to use some sort of Command-Ctrl-Shift-4 keystroke for the actual desktop switching.

Turns out, the laptop has a built-in motion sensor. Nominally, it's there to protect the internal hard drive. The basic idea is this: If the accelerometer suddenly notices that the gravitational pull of earth is no longer present, the most likely explanation is that the laptop, sensor and all, is currently accelerating at 9.81 m/s² towards said earth. In that case, it will (wisely) try to turn the hard drive off in preparation for impact.

It can, however, also be used in situations not involving lobbing the laptop across the room, fun though that may be.

7/30: And now, the "official" IBM version for ThinkPad, which lets you use "shave-and-a-haircut" as your screen-saver password.

6/29: Smack your Nokia phone

6/27: Smack the penguin: GTollina.

6/17: Less violent (light sensor based) version now out.

6/7: Tom Merritt at c|net has posted a tutorial video of sorts. Thanks!

6/5: Here comes the SmackPad - courtesy of Michele Campeotto, you can shake your IBM ThinkPad to bits too.

5/31: Lincoln Ramsay has released UniMotion, a small open source library for reading the motion sensor. It supports iBook, PowerBook and MacBook Pro, old and new. Go Lincoln!

The latest release of VirtueDesktops supports the NSRemoteNotificationCenter protocol detailed below, so steps 1-7 of Dave's illustrated instructions have been superseded by "Install VirtueDesktop."

5/26: Any OSX developers looking for a fun hacking project? CGSSetWindowWarp is still virtually unused.

If you're on a PowerBook or iBook, see comment #136. For sensitivity issues, see #152.

All code in this post is released under the GPL.

Desktop Manager patch

First, you'll need to be able to control Desktop Manager from outside. Cocoa has a nice class called NSDistributedNotificationCenter which can handle simple message passing between applications. DM uses a notification center internally to send "next desktop", "previous desktop" commands to itself, so the patch just replaces the normal version with the distributed version. I added the following to WorkspaceController.m, inside the init method:

[[NSDistributedNotificationCenter defaultCenter] addObserver: self
    selector: @selector(selectNextWorkspace)
    name: NOTIFICATION_NEXTWORKSPACE
    object: nil
];

[[NSDistributedNotificationCenter defaultCenter] addObserver: self
    selector: @selector(selectPreviousWorkspace)
    name: NOTIFICATION_PREVWORKSPACE
    object: nil
];

To control all the windows in the system, an application needs to have access to the CGSUniversalConnection; only one application can have that at a given time, and the Dock tends to win the battle. Desktop Manager sneakily uses mach_inject to inject its own code into the Dock application. There's still no x86 version of the sweet, sweet mach_inject library (Wolf! Help us!), so not all the Desktop Manager features will not work on Intel.

Reading the sensor

For the actual sensor reading, I used amstracker by Amit Singh. He does not allow redistribution, so you'll have to get it directly from the source.

notify: Remote control for Desktop Manager

This 15-line program lets you send random notifications to any running application.

#import <Foundation/Foundation.h>

int main (int argc, const char * argv[]) {
  [[NSAutoreleasePool alloc] init];

  if(argc != 2) {
    NSLog(@"Use: %s notification-name", argv[0]);
    return 1;
  }
	
  [[NSDistributedNotificationCenter defaultCenter] 
    postNotificationName: [NSString stringWithCString: argv[1]]
    object: nil];
  return 0;
}
Compile it with gcc -framework Foundation -o notify notify.m, then call it with ./notify SwitchToNextWorkspace.

Actual motion interpreter

You can do arbitrarily fancy stuff here; this 10-line Perl script just checks to see if the horizontal acceleration exceeds some threshold in either direction, and calls the notify program.

use strict;

my $stable;

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

    # we get a signed short written as two unsigned bytes
    $a[0] += 256 if $a[0] < 0;
    my $x = $a[1]*256 + $a[0];

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

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

Summary

Here's a self-contained zip file of the above patches.
  1. Install and run the patched DesktopManager
  2. Download and unzip the zip file above (I just updated it with a binary version of notify, so you'll have to re-download it)
  3. Download amstracker from osxbook.com (I'm not allowed to redistribute it)
  4. Place the amstracker binary in the directory where you unzipped smackbook.zip.
  5. You should have a directory with the files amstracker, notify and smack.pl. From the terminal, in that directory, run the command perl smack.pl

TrackBack

Listed below are links to weblogs that reference SmackBook Pro:

» Smackbook from The Blog From Another Dimension
This is a cute little video showing a clever Mac Hack. Apple laptops include a hard disk motion sensor, intended to stop the hard drive whenever a sudden motion is detected; this was intended to prevent disk crash damage when a laptop was dropped or ja... [Read More]

» SmackBook from www.blogmemes.jp
MacBookをぴしゃりと打つタスクの切り替えが出来る! Hackは下記のURL[英語]からダウンロード出来ますがインストールはちょっと難しそうです。 http://blog.medallia.com/smack [Read More]

» Smack your Apple Laptop? from semaja2's Site
This video shows a clever use of the Apple sudden motion sensor. Simply tap the side of your MacBook and the desktop switches. Sadly, the URL at the beginning of the video is password protected. Here’s hoping somone releases the code. [Read More]

» smacbook pro from Andrew Prendergast
From dave: > Now THIS is cool and one very good reason for owning a Mac : > > Whack ya Mac! > > Watch the video. >... [Read More]

» SmackBook Pro? from russ@isitaboat
Very cool use of the inbuilt motion detector on a Mac Book Pro. Its normally designed to stop the hard-disc incase of the laptop falling - which helps save extensive damage. In this case, its used to switch between multiple desktops! Pretty cool - c... [Read More]

» SmackBook Pro from Stone's Blog
Virtue の仮想デスクトップと,振動センサーを使ったMacSaver の話題から,このアイデアは自分でも思いつきたかった. SmackBook Pro しかし,デスクトップが切り替わるときってハードディスク [Read More]

» Smack Your Mac Up from The Osesm Report
I've always been a proponent of physical reinforcement. Why do I have to use a key combination to switch virtual screens? Why can't I just give it a sweet love tap, like the e-bully I am. Erling Ellingsen posted a way for me to command my Mac like the cow [Read More]

» MacBookでモーションセンサーを使ったツール from BUZZ LIVEYEAR
 Via 秋元@サイボウズ研究所プログラマーBlog  ノートブックを落としたと... [Read More]

» "Smackbook Pro" switch desktops by touch from Lifehacker
Mac user and developer Erling Ellingsen is putting the new Macbook's motion sensor to work with his virtual desktop manager. He can switch desktops by hitting the side of his "Smackbook Pro." Check out the video to see it in... [Read More]

» How to make your own Apple SmackBook from
Did you like the SmackBook Pro video from the other day? Here's how to make your own...enjoy! [Read More]

» The Smackbook from Paul Venezia
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... [Read More]

» SmackBook Pro from Gizmodo
I gotta admit, the MacBook Lightsabre was pretty cool, but the SmackBook is even cooler, and actually useful. This latest little mod utilizes the motion sensor to swap between desktops on the MacBook. The sensor was originally included in the... [Read More]

» The Smackbook from Paul Venezia
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... [Read More]

» 精密機器です。叩かないでください。 from Diary::Weblog
最近、妙にアップルのラップトップに採用されている緊急モーションセンサ技術を利用したソフトが多いような気がします。 つい先日もMacをライトセーバーにできるMacSaber 1.0 Betaなんてい... [Read More]

» The SmackBook Pro from evolvefuel
An interesting use of the MacBook Sudden Motion Sensor to switch desktops. (via TUAW) Update: The Medallia Blog just released the source code, you can follow their instructions here. ... [Read More]

» MacBook HD Accelerometer + Window Manager = Great Hack from Josh's Weblog
While this hack is currently available for MacBooks, I wouldn't be surprised to see someone implementing the idea in Linux or Windows. It's a cute trick to use the accelerometer used to protect laptop hard drives from sudden movement as... [Read More]

» Physical Interfaces from Sacrificial Rabbit
Even if you aren't really into comptuers and assorted geekery, you must check this out: Smacbook Pro. This is by far one of the coolest, most intuitive human - computer interfaces I have seen in a long time. I want one that when I smash the desk in fu [Read More]

» Smack you Mac up .. from c0t0d0s0.org
Ich koennte heulen ... ich moechte auch einen ein Powerbook mit Sudden Motion Sensor. Denn damit lassen sich so praktische Dinge, wie dieser aeusserst intuitiv bedienbare Desktopumschalter realisieren. [Read More]

» バシッと叩いてタスク変換:SmackBook Pro from Long Tail World
Did you know it was a Japanese Mac blogger 'mo' that first succeeded in Fast OS switching within 3 days after the purchase of black MacBook and uploaded its video to here on YouTube? Shiro was all excited about this news! (maclalalaweblog). Well, thi... [Read More]

» 【デモ動画】MacBookの仮想ディスクトップをモーションコントロールで切り替え from YappoLogs
VirtueDesktopsとParallelsを入れてわーい^^わーい^^してたら。 SmackBook Proというのを発見した。 でもこれは、他の仮想ディスクトップソフト使ってるし、パッチ当てなきゃいけないのでめ... [Read More]

» Mehrere Desktops from PFUY!!!
Irgendwo hatte ich in der New York Times mal gelesen, dass die Arbeit mit mehreren Bildschirmen die Produktivität um 30% steigert. Ich kann das für meine Fälle auf jeden Fall bestätigen. Das nervige Fenster wechseln macht es zum Beispiel unheimlich... [Read More]

» SmackBook Pro from WizbangTech
Code and instructions on how to make this work on any PowerBook or MacBook with the built-in motion sensor at Medallia Blog.... [Read More]

» SmackBook from Stefan Tilkov's Random Stuff
An even cooler use of the MacBook Pro’s built-in motion sensor: SmackBook Pro. I’m no virtual desktop fan, but I’m tempted to install this just for the Wow! factor.... [Read More]

» Frappez votre MacBook from Just for fun !
Erling Ellingsen est un dveloppeur qui a l'habitude de travailler avec du multi-cran. Or, sur un portable, le multi cran est oublier, pour cause de "portabilit" justement ! Quoi que... Son MacBook est quip de la technologie Sudden... [Read More]

» Two great ways to destroy your MacBook from blog^2
Motion-activated virtual desktops Turn your laptop into a light saber (sound machine)... [Read More]

» Get your own SmackBook Pro from Jon Baer
I tried the Desktop Manager and Expose Smackbook hacks on my wife's MacBook today, a very cool use for the built in motion sensor. They need to make one for Windows so you can make your reboot experience better [Read More]

» SmackBook Pro from O'Grady's PowerPage
This you've just got to see: I usually keep two 20" screens side by side on my desk, so I can code on one and test on the other. I find I can work much faster if I can... [Read More]

» Can your wintel box do this ? from david.olrik.dk
All new *Books from Apple has a build in motion sensor that is there protect the harddrive for harm, should you descide to hurl your *Book through the room. Some clever guys wrote a piece of software that that allows you to use the sensor to perform actio [Read More]

» Can your wintel box do this ? from david.olrik.dk
All new *Books from Apple has a build in motion sensor that is there protect the harddrive for harm, should you descide to hurl your *Book through the room. Some clever guys wrote a piece of software that that allows you to use the sensor to perform actio [Read More]

» SmackBook Pro, où comment changer de bureau virtuel sans le clavier from Casualtek
Pour ceux qui ne connaissent pas, les bureaux virtuels sont autant de moyen de faire semblant de disposer de plusieurs écrans alors que, concrètement, on n’en a qu’un. Pratiquement, on peut disposer d’un bureau principal dans lequel... [Read More]

» SmackBook Pro from In Earshot
Adventures in computer interface design: SmackBook Pro... [Read More]

» Klopfen zum Desktopumschalten from Open Source Jahrbuch Blog
Eine innovative Technik zum Desktopumschalten wird hier vorgestellt: blog.medallia.com [Read More]

» Smack it! from mittendrin statt nur dabei
Ich dieses unglaublich coole Spielzeug für meinen Mac gefunden. Bildschirmsteuerung durch hauen... besser wird es nicht. Leider war die Steuerung nicht perfekt. Ich habe das perl-Script ein wenig modifiziert, so daß es sich an einem Zeitmittel kalibrier [Read More]

» SmackBook Pro from Abacus::blog
コンピュータの調子が悪いときに,未だに叩いて直そうとしてしまうことがあるが,どうせならひっぱたいて操作するくらいの方が健全なのかもしれない. [Read More]

» VirtueDesktops r155 released from lunatic bumblebee
Tony has released another official build of VirtueDesktops This build contains numerous enhancements and bug fixes to core functionality, but I don’t believe you’ll notice most of it. This build also incorporates a very early version of motion-based d [Read More]

» FRIST POST!!!!!! from draining the world's beer supply one pint at a time
Ran across the Smackbook hack a little while ago, and after mentioning it to my boss was inspired to modify it very slightly so instead of switching screens, it just screen locks. Get up to leave your desk and smack your powerbook to turn on the screen... [Read More]

» Here comes the SmackPad from micampe.it
You probably have seen the SmackBook video where a guy smacks his laptop to switch workspace. Too bad that only works on Macs right? Not really, my ThinkPad has a device similar to the Apple Motion Sensor and it runs Linux, so it ought to be flexible a... [Read More]

» Smackbook for Power Book G4 from ナチュ日記。
年末に Power Book G4 を買って、まもなく発表された MacBook... [Read More]

Show Trackbacks

Comments

2

Nice to see that the site is finally online :)

Thanks for the code. I might even want to steal your map in the header since I'm another scandinavian living in the SF bay area...

Jim

3

Nice. I will definitely give this a shot.

4

Did you have to compile DesktopManager on PPC? No luck getting it to compile on Intel...

5

Has anyone figured out to implement this? And will it work with Virtue?

6

does anyone have step by step instructions on how to make this work or a possible installer?

thanks

7

ok if anyone gets to compile this for intel macs email the package to me please at j.ruiz_isenberg@mac.com, i already downloaded n accepted the terms for AMStracker

8

Awesome demo. But I think us non-developer types need step by step instructions on how to get this to work.

9

If somebody can compile it for mac intel
please mail me
Thanks

10

sdaudet@freesurf.fr

11

Would this work for G4 PowerBooks? They have motion sensors that disconnects the hard drive if it were to be dropped.

13

Looks awesome but need step by step instructions, most of us are not that smart. Or it would be nice if you developed an app that will do it for you, Email me if there are any updates. I have the new MacBook.

14

Here you go, patched and built on intel:

http://ritalin.simplylinux.org/DesktopManager-0.5.3-patched.zip

15

I agree with Jeff. We aren't that smart. Mac users are simple folk who need very simple instructions. Please limit clicking to one button and all that.

Maybe you can work with Richie and make an update for Desktop Manager. That'd be swell.

16

I'm not that good with all of these commands so could you make like an app that would install it for us, or at least some step by step instructions. BTW, I have a G4 Powerbook 15" HR Latest Revision, will this work for it?

Thanks in advance

17

Hey Jeff, your ZeroLink settings are wonky on the patched build you posted. ;)

18

has anyone gotten this to work? im stuck on the first thing in this article.

can we get some step by step guide for this?

19

ok im getting a bit aggravated cause when i try to compile im getting terminal to freeze when dealing with python, i tried the patched file and it wont even launch, PLEASE email me a solution or instructions at j.ruiz_isenberg@mac.com

20

I've updated my archive with a binary that didn't have ZeroLink enabled. Please try the new archive if you're having problems.

21

I'd like to get this to work too. Some easy instructions would be appreciated. thanks!

22

I tried the patched and compiled version from nivfreak above, but it doesn't work. Desktop Manager runs, but no motion sensed switching --- did I not figure out how to turn it on?

I'm on an intel macbook pro.

24

Okay cool - I can verify this works - quite well actually. I can carry it around without unintentional screen slides pretty good.

26

Hey. Just so you know there is a mach_inject intel version. I downloaded it a few days ago but dont remember where but if you need it let me know. Also, to enable all the features for DesktopManager or VirtueDesktops (like being able to move windows across desktops) all you have to do is add yourself to the procmod group....

To check who is in the procmod group, use the following command:

sudo niutil -readprop "/" "/groups/procmod" "users"

To add yourself to the procmod group use this command...
sudo niutil -appendprop "/" "/groups/procmod" "users" `id -un`

To remove yourself from procmod group, use the inverse command:
sudo niutil -destroyval "/" "/groups/procmod" "users" `id -un`

I also have DesktopManager 0.53 and 0.6 available as universal apps. SO if anyone would like to host all this let me know as well...

27

Thanks, Josh! That's one less project I need to do :-)

I'll have to look for an open source replacement for 'amstracker'. I have what I need to make one for my MBP, but that would not work with older versions of the hardware. No time today, I have to do some actual work...

28

"DesktopManager 0.53 and 0.6 available as universal apps"
vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv

http://forum.osx86project.org/lofiversion/index.php/t12363.html

+ mach_inject hacking for 10.4.4 and up (Intel Build)

29

how would modify the sensivity in the perl script, im not familiar at all with perl and it just doesnt feel right on the 12 inch PB

30

I installed it on my PowerBook, and it must not have the same motion detector or something... Can't really control the desktop switch, with smacking...

31

Great app! Thanks to nivfreak for uploading a patched version of Desktop Manager. Hell if I know how to do patch an app. I am curious, though, as to whether or not I can set this to run in the background, so I don't have to keep that Terminal screen up and running all the time.

Cheers.

32

So, I take it none of you computer geniuses ignoring the requests for instructions can give them? Keep talking over everyone's head and we'll think you're cool.

33

is this bad for the computers? i would feel like a real idiot if i broke my computer by slapping it.

34

Working Desktop Manager UniBin url:
http://www.arenasoftware.com/grepsoft/DesktopManagerUB-0.5.3.dmg

35

Bob: nivfreak made a nice, working, friendly installer, but we're not allowed to post it publicly since Amit Singh does not let other people redistribute his software. We're, among other things, discussing what we can replace it with.

Given enough time, I'd like to write a plugin for DesktopManager so everything would Just Work. Unfortunately, I have to do some real actual paying-the-bills kind of work too... :-)

Pat: I wouldn't recommend using it if you're upset. In fact, I wouldn't really recommend using it at all. It's just a fun hack.

36

Bob, et al: I think there might not be an easy solution (on Intel machines, at least). We have to use advanced terminal commands (which I myself copy & paste from pages like this) to change system-wide security settings in order to get full functionality on OS X for Intel. In my opinion this *should* be difficult because we're reopening a security hole that was recently closed by Apple. I guess we need to be patient, but I'm not sure who will want to simplify a process that reopens a security hole.

37

could anyone post what version of desktop manager this guy was using? when i try to run his patch in the terminal i simply get a string of errors !!

38

I've asked for permission to redistribute AMSTracker. Until then, I can't post the installer I made here.

The instructions in the blog are about as clear as they can get. If you grab one of the patched desktop managers, it should be easy enough.

39

"If the accelerometer suddenly notices that the gravitational pull of earth is no longer present, the most likely explanation is that the laptop, sensor and all, is currently accelerating at 9.81 m/s² towards said earth"

You've got it backwards. First of all, it's an accelerometer which means it measures, you guessed it, acceleration. Which means it's measuring that 9.8 figure you've got there. What it's looking for is an explanation FOR the acceleration--it doesn't conclude that acceleration is the likely cause.

Secondly, the fact that it's falling/accelerating means that the pull of earth is very much present. Gravity makes things fall. If "the gravitational pull of earth is no longer present" then nothing would fall to earth in this way.

I think what you mean to refer to is the normal force of something (table, floor, lap, etc) which acts opposite gravity and keeps the notebook from falling. Lack of this, and not gravity, is indicated by a reading on the accelerometer. Gravitational pull is more or less constant whether falling or sitting on a table.

41

nivfreak

cheers for the reply, however, im running on a 17" 1.67ghz machine. its still PPC, not intel. all compiled ver. are intel!

42

Can someone post either the patched G4 version of DesktopManager or how to run the patch? Sorry if it seems like an elementary question.

43

Try the universal binary in comment #34.

44

That version (from comment #34) doesn't seem to be the patched one, or at least it doesn't work for me.

45

umm tried dling that one, tried to run the patch, patch didnt work...in the end, still not up n running *perplexed* any help is greatly appreciated!

46

btw, Nik, i think we're in the same boat here lol.

47

How about using motion.c i use it in MultiAlarm and i can easily show you how to implement it into your program

48

semaja2: That's the plan. I just have to do some Actual Work first.

Do you have a version that works with both the 8-bit and 16-bit motion sensors? I found a IOI2C version of motion.c and hacked SMCMotionSensor support onto that. I tried googling for SMCMotionSensor but found... little.

49

how do you compile DesktopManager? I couldn't find a makefile? What commands do you issue to compile it???

50

Nice idea, but too geeky, I feel like I will never get laid again like the guy in the video if I install that patch.

51

Please post a working link to a patched version of Desktop Manager for PPC/UB as I can't get one to work.

52

Too cool

53

what's the little app runnign which seems to be a window full of water droplets or balls or something that responds when moved around?

54

Thank you for the clearly detailed instructions. I was able to get it to work without any hassle however my motion sensor does not appear to be as good as yours. I have the newest rev iBook G4. There does not appear to be any consistent value change from AMSTracker so I cannot have a consistent desktop change.

55

its hard to beleive really..

i wonder what apple thinks when they would see this ?

56

49/stef: you use xcodebuild, which is the Different Make. Or just use the shiny Xcode gui.

50/machodude: thanks for sharing

51/Obi: nice friendly installer forthcoming; check back in a couple of days

53/iain: Another toy project. Tune in next week :-)

54/bhanson: Try removing "$a[1]*256" from the perl script -- that is a workaround for a bug in amstracker, but I don't think that bug is present in the iBook version (amstracker on MBP will report lobyte(x), hibyte(x), lobyte(y) instead of x,y,z)

55/josh: "let's stock up on replacement hinges"

57

Thanks, hope it turns out great.

58

The UB-DM at #34 doesnt seem to work at my powerbook g4.
Cant we mail a working version to each other?

59

I tried the UniBin file #34 on my MacBok Pro, but it does not seem to work as advertised ... The desktop manager works fine, but no "SmackBook" capability is working.

Am I missing something?

60

Fixed it, works *pretty* good.

@56 and all: I needed to re-calibrate the smack.pl script, specifically the thresholds, that was all.

61

Why don't you use c0re in motion (http://blogs.23.nu/c0re/stories/7894/)?

62

Great stuff, im a totaly noob when it comes to this kinda thing but got it working great, used the patched intel version for my macbook pro and it works fine. I have to hit it quite hard for it to work though, is it possible to adjust the sensitivity somehow?

63

at #56

After removing "$a[1]*256" the sensitivity still isn't great, any tips because i don't know any perl... :)

I have the lastest iBook g4 btw.

64

@ 60

care to spread the knowledge bhanson? ;)

65

Any reason Desktop Manager is used rather than Virtue?

66

Have it installed but not patching. Do you need to run the gcc script or just the smack.pl? The instructions seem to be saying the the smack perl completes everything. I don't feel like downloading XCoce 951MB to do something I don't need.

67

Erling,

This is so cool. I modified your motion interpreter script to trigger Expose. You can find it here:

http://jepstone.net/blog/?p=528

- Brian

68

wow that is actually very cool :o unfortunatly i dont have any fancy macbooks but i wonder if i could make somthing that hooked up to the serial port or usb port of my pc and could be attached to the monitor or somthing...

69

hey, het lukt me voor geen meter! is dit nep?

70

Hi!

I am trying to build Desktop Manager with XCode, with the patch applied, but it gives me the following error: "undefined compiler specification com.apple.compilers.gcc.4_0; specification may be missing or target may be misconfigured". What am I missing? Thanks for the help, I am no good at XCoding...

71

So cool.... My MacBook is currently in the process of being shipped so this is /definitely/ something to play with after porting DM.

72

Heya, why not use Virtue Desktop as opposed to Desktop Manager? It's basically what Desktop Manager has become, and it's univ. binary.

http://www.macupdate.com/info.php/id/16530

73

is there anyway we can get some kind of install for us non-coders? I would love to be able to do this, just don't have any background with coding.

74

How do you patch the Desktop Manager or where can I download a patched version for PPC? I can't figure it out.

Thanks.

75

For everyone asking for directions without coding - go read the instructions given in the comments. It requires one simple terminal command. That's it.

About hinge replacements: you can tap anywhere on the notebook to trigger a change, the sides near the front, on top of the palm rest, etc.

About the comment on gravity - relative to the sensor, if the laptop is falling at terminal velocity then gravity is no longer present. In other words, the only time you don't feel the effects of gravity is when you're falling. Relative to yourself, you're weightless. This is why they film space scenes for movies in airplanes flying straight down.

Of course, if your notebook is falling at terminal velocity, no hard drive parking feature is going to help it survive.

76

Alright, let's try this again. This package should work for both PPC/Intel users (Universal binary)

This does NOT include AMSTracker. You still have to download it, and put it in your path (e.g. /usr/bin/)

SmackBook will just keep bouncing in the dock, but it should work anyway. You'll also have to kill AMSTracker by hand.

http://ritalin.simplylinux.org/SmackBook-0_1a.zip

I'll fix the couple of gotchas above when I have a chance.

77

First off, a big thanks to the people who've submitted installers, patches, etc. God knows more're on the way...

As for sensitivity - I'm not familiar with perl, but just to let similar users know, here are the settings I use to make the triggering process less...violent on my MacBook Pro:
-------------
I change the 'stable' number to 60:

if(abs($x) ...
And the conditional numbers both to 30:

if(abs($x) > 30 && $stable > 40) {

---------
As simple as this is, I haven't puzzled out exactly what all this means yet. Either way, it definately makes it USEABLY sensitive, as seen in the video - at least on my MacBook Pro.

Kudos to everyone, and can't wait to see where this is headed!

78

how do i put amstracker in my path? If i have the installer on my desktop where should i put the amstracker in order for this to work.

79

Grr. Oops, should've edited. Looks like one line became an HTML tag...one more time:

----------
I change the 'stable' number to 60:
if(abs($x) > 60) {

And the conditional numbers both to 30:
if(abs($x) > 30 && $stable > 30) {
----------

For anyone truly lost, just edit smack.pl in a text editor and save. :P

Viva sensitivite!

80

What Amit in comment 78 said. I am confused.

81

I agree, where is my path? I cannot find "/usr/bin".

82

For those who're stuck on step one:

1. Download the patched installer (I'm not gonna tell you which one, as some say it works and some not, but I'm using the one ala comment #14)

2. Put that in your Applications folder.

3. Start it up.

4. Download Amstracker, ala top of the page (original instructions)

5. Re-read original instructions, but here ya go again:

a)put the contents of smackbook.zip in a folder, any folder - preferably one to which you have access and priveledges :D. Mines in ~/Smackbook.

b)put the contents of the amstracker download into the same directory (~/Smackbook in my case)

c) Go to terminal, navigate to ~/Smackbook, and type: perl smack.pl

d) Smack your book.

6. If it seems to happen irregularly, or only when you physically MOVE the laptop, check out my directions in the last couple of posts for adjusting the sensitivity. If it's not happening at all...I dunno. Worked for me. :P

83

Just so nothing's ambiguous:

In step 1 I'm referring to the patched Desktop Manager installer in #14. Put THAT in your Applications. Everything else goes anywhere you want, as long as it's all together. Also, keep in mind that you have to keep the terminal window opened (or hidden, whatever) for this to work.

I also missed the step where you download Smackbook.zip. I assume you've gotten that far. :P

84

***Step-By-Step instructions for non-programmers***

http://squarejelly.blogspot.com/

85

The problem I have is that the patched version of Desktop Manager posted seems to be intel only.

86

@ comment 84: Alright, great, but how do I patch Desktop Manager on PPC? I can't use the Intel compiled Desktop Manager that nivfreak posted.

87

@comment 85/86: Sorry I don't have the answer to that one ... I'll defer to the experts ...

88

And here's an interesting quirk. Since you can now change desktops without using mouse or keyboard input, you can have a screensaver enabled on on desktop and navigate to another without upsetting it. You can even use the keyboard, etc and the saver will still be running on the other desktop. The only caveat is that since only 1 instance of the saver will run at a time, you WON'T get one on your alternate desktop. Still coo', though.

89

@comment 85/86: Does the file from #34 work instead of what I had linked to: http://www.arenasoftware.com/grepsoft/DesktopManagerUB-0.5.3.dmg

90

Well, everything works from the application's point of view at this point, I think I have a problem with my motion sensor.

I noticed the problem because after running smack.pl my powerbook just kept rapidly switching desktops from left to right until I killed the program. After running

./AMSTracker -u 0.1

I found that when completely level, my powerbook reports between -3 to -5 on the X-axis. In other words, it seems to be miscalibrated(lifting the right of the powerbook about 2 inches gives a more stablized zero.

So my question is: Does anyone know how to recalibrate or reset the motion sensor, and if not... would it be possible to define a shifted threshold within the perl script?

91

@comment89 - Nope. Terminal just says Simulating AMS hardware in sorftware but nothing happens when I hit my powerbook.

92

The zip I attached above includes universal binaries for notify and Desktop Manager (patched).

Just download the installer, run it, and then make sure AMSTracker is in your path (copy it to /usr/bin inside terminal)

93

nivfreak, I've done as you said but I've got two problems:

1.)Nothing happens at all when I run this version of DM.

2.)I don't use the terminal and so I don't know how to copy to this location.

Thanks

94

@comment 91: Does the desktop manager work at all ... even without the smack.pl running?

95

@comment 94: Yes, the version I was using in 91 ran fine (and exactly the same) with or without smack.pl running.

96

@comment 91: Neil, the mesage you receive "simulating hardware in software" ... I'm thinking your powerbook doesn't have a motion sensor ... hence the "simulating in software".

This is a different message than I get ... my message says "AMS hardware present and initialized" ...

97

I do have the motion sensor, I've played a bit with AMSTracker and AMS2HID already so I'm sure of that. I was getting the intialized message too don't know what was different that time.

98

@comment 92: The desktop manager in your package starts and then crashes. If I try to launch it seperately, it does the same thing.

99

@comment 97: Neil, try the file from post #77 instead of the link I originally posted in my tutorial for the SmackBook code ... yes my link in up to date as well ...

Thanks nivfreak!

100

@ nivfreak

Hi-Res PowerBook G4 1.67 GHz

The Desktop Manager app that gets installed by your .mpkg does not open. Not sure if this is normal, though I would expect not. I do have AMSTracker in /usr/bin. I do appreciate all the work you guys are doing trying to get this to work for the less tech-savvy among us.

101

Erling- nice work,
I took your base idea, and created a perl script and stuartup item with some more custom options, as well as independence for desktop switchers:

http://www.eastrain.com/ams_switch.zip

AMStracker still is needed to be put in the startupitem before installation FYI.

This was built and tested on a 12" 1.5GHz, but others may want to change the sensitivity.

Based on the concept that this should not be used except on a table, or other stable, level surface (I had a version at one point that worked on the principle of tilting the laptop, but this was near useless except on one leg while sitting...), I proceeded to change stable to become 0 the instant the laptop is titlted at all in either x or y, thus preventing a count except when perfectly level for the set interval. I also added an offset value to tweak for levelness for those of us with not-so-flat sensors. I found that by using a fractional value, fluctuating values detected by the ams sensor as it rounds can also be accounted for.
I removed the need to use notify, although it does perform spectacuarily with your patches. Instead, I make use of applescript to call key codes to trigger the switcher, as one normally would. This is also very easy to customize, as keycodes can be obtained from many utilities (notably Ukelele).
I also added a counter system to keep track of the number of desktops switching between.

One could take this script and remove the limiter, change the applescript to call itunes track and volume changes, safari navigation.... whatever...

Great inspiration, and hopefully we don't all scratch the hell out of our drives....

-dan forsythe
defor@mac.com

102

@comment 91: The same thing (AMSTracker reporting that it's simulating AMS hardware in software) also happened on my PowerBook 12" after a while. It seems like something regarding I2C is messed up (a few lines with warnings are written into /var/log/system.log every second), rebooting seems to help. Seems like AMSTracker triggers some kernel bug..?

I've also got problems (like many others with powerbooks?), that tapping doesn't trigger anything. When calling AMSTracker directly, the x-values only show -1 or 0, and tapping/smacking the pbook on any side doesn't really give any change in this value. Tilting it is the only thing which actually gives a noticable change in the values.