It should be possible by polling the sensor periodically and compare the sensor data with the data from the previous poll. However, polling requires a significant amount of system resources when peformed in short intervals which are necessary to detect short sudden movements.
Most accelerometers have options to generate interrupts on specific conditions. But using these requires that the device (the MacBook) supports them and the accelerometer can be programmed using the library (the library sources should show if this is possible).
If the MacBook is laying on the table the sensor data should be near zero for the X and Y axis and 1.0 for the Z axis (or -1.0). When it is moved, the data will change accordingly.
Because the data are noisy it might be necessary to filter them when slow and small movements should be detected. A simple filter uses a factor below 1.0 (for each axis):
filtered = actual_value * factor - prev_value * (1 - factor)
prev_value = filtered_value
You can then optionally calculate the pitch and roll:
x_norm = x / sqrt(x^2 + y^2 + z^2)
y_norm = y / sqrt(x^2 + y^2 + z^2)
pitch = asin(x_norm)
roll = asin(y_norm / cos(pitch))
I suggest to write a simple application that polls the sensor and prints out the raw and calculated values. Then you can play with it to find out the required limits when moving.