Does anyone know how to attach a motion sensor to a laptop and be able to translate signals into a mouse click or run an automator script.

Thinking about using this for my ibook e-picture frame conversion. The slide show(screen saver) will be on as long as it is detecting motion and be awaken from sleep when motion is detected.