Mac Duo

Engineering

How Mac Duo reads your MacBook's lid angle

Mac Duo turns your display into a pane of frosted glass that leans away as you close the lid. It can only do that because some MacBooks will tell macOS, continuously, how far open the lid is. This is how the app finds that number, checks it is real, and turns it into the fold.

What a MacBook lid-angle sensor is

Nearly every laptop can tell that its lid is shut, so it knows when to sleep. On a MacBook that is typically a magnetic sensor, and it answers one question: closed, or not closed. It is a switch.

A continuous lid-angle sensor is a different component answering a different question. It reports the hinge angle as a value, and keeps reporting while the lid is in motion. That is a measurement rather than a switch, and it is the only one of the two that can drive something which follows your hand. The MacBook lid-angle sensor covers the hardware itself in more detail.

Why Mac Duo needs the angle, not a trigger

A timed animation only knows that something started. It picks a duration and plays. Close the lid slowly and the animation finishes long before you do; stop halfway and it carries on without you; open again and it has to guess whether to reverse.

With an angle there is nothing to guess, because the fold is not playing at all. Each reading is a position. The same angle always produces the same glass, which is why opening retraces closing instead of running a second animation backwards. It is also why stopping halfway simply leaves the pane where you stopped.

From lid movement to rendered glass

The pipeline is short on purpose. Your hand moves the lid; the sensor reports a new angle; the fold controller turns that angle into how far through the fold the pane should be; the renderer draws that state over a live capture of your display using Metal.

While the lid is moving, the view runs at 120 frames per second. The glass is built out of your real screen rather than a screenshot, which is why windows, wallpaper and menu bar all lean together as one surface — and why the app needs Screen Recording permission. How Mac Duo works walks through the rest of that pipeline.

How Mac Duo finds the sensor

The app does not assume a particular device exists on a particular model. It searches in widening passes: first for interfaces that declare the lid-angle usage outright, then more broadly across Apple's internal sensor interfaces, because some of them identify themselves inconsistently and a narrow search walks past them. The first pass that finds something usable wins.

Being found is not enough to be used. Every candidate has to be an Apple internal sensor, and its own report descriptor — the machine-readable description a device publishes about the data it emits — has to declare a field whose range really is a full circle of degrees measured from zero. A sensor that merely sounds right does not pass; the description of the data has to agree.

That is deliberately stricter than matching on a name, and it cuts both ways. It rejects the other sensors sitting alongside the lid-angle one, which publish plain byte ranges with no angular meaning. It also leaves room for a future Mac that reports the same measurement under a different identifier, because the test is what the sensor says it produces rather than what it is called.

Only then does the app read a value, and it still checks that the number lands inside a real range of lid travel before trusting it. Mac Duo only finishes starting once it has read a genuine angle, so there is no invented starting position.

Why some MacBooks work and others do not

This is hardware, not software. A MacBook either exposes a continuous lid-angle measurement to macOS or it does not, and no application can add one. When Mac Duo cannot find a usable sensor it says so at first launch, in those words, and does not fall back to a timed animation — a fold that runs on a timer is not the thing this app is for.

Apple does not publish a compatibility list for this, which is why the app checks your own machine rather than a model table. Mac Duo compatibility has the supported and unsupported lists, a read-only sensor check you can run before you buy, and the compatibility guarantee that goes with them.

Why an accelerometer or gyroscope is not the same thing

A MacBook can carry several sensors that sound like they might do the job. An accelerometer measures acceleration, including gravity, so it can tell which way up the machine is. A gyroscope measures rotation. An ambient light sensor measures brightness. All three describe the machine as a whole, or its surroundings.

None of them describes the relationship between the two halves of the machine, which is the only thing the fold cares about. Tilt a MacBook on a desk and its orientation changes while its hinge angle does not. That is not a limitation Mac Duo chose — it is what those sensors measure, and it is why the validation step looks at what a sensor reports rather than at how many sensors a Mac has.

Resting angle and calibration

The fold is measured from where your lid normally sits, not from a fixed number of degrees. Someone working at 100° and someone working at 130° should both get the full fold from their own starting point. By default the app learns that resting angle as you use it.

Learning has an edge to it, though: if you work at an unusual angle, the learned value can sit somewhere you did not intend. So you can set it explicitly. Recalibrate Resting Angle takes the lid's current position as your resting angle and keeps it — an explicit choice takes precedence over the learner, and it is restored when you next launch the app rather than being relearned from scratch. Resetting hands the resting angle back to the automatic behaviour.

Minimum movement

Not every touch of the lid is an attempt to close it. Minimum movement sets how far the lid has to travel from its resting angle before the fold engages at all, from 1° up to 15°. The default is 1°, which reproduces the animation's original behaviour exactly, so nothing changes for anyone who leaves it alone.

Raising it is for people who nudge the lid while they work. At 5° or 10°, small adjustments leave the glass alone and only a deliberate close brings it in.

What happens when the lid stops

Screen capture stops about a second and a half after the lid settles, and the fold drops to a stationary frame rate you choose: 15, 30, 60, 90 or 120 frames per second. Fifteen is the default and the lowest, and a lower stationary rate does less work while the lid is sitting still. Moving the lid brings it straight back to full rate.

Checking your own Mac

The compatibility page has a single read-only command you can paste into Terminal. It asks macOS whether the lid-angle interface is present, installs nothing and changes nothing. A device listed means your Mac exposes it. Nothing listed is a strong signal but not proof, because the app searches more broadly than one command can and validates what it finds.

Run the compatibility check before buying if you would rather be sure, or read what the iPhone Duo fold looks like on a MacBook for what you would be getting.

Questions

Does Mac Duo work on every MacBook?

No. It needs a MacBook that reports its hinge angle continuously, and not every model exposes one. The app checks your own Mac on first launch rather than going by model name, and says so plainly if it cannot find a usable sensor. The supported list, the sensor check and the compatibility guarantee are all on the compatibility page, and it is worth reading before you buy.

Why does Mac Duo need a lid-angle sensor?

Because the fold is a position, not an animation. Every angle of the lid corresponds to one state of the glass, so the app needs to know where the lid is at each moment rather than simply that it started moving.

Can software add a lid-angle sensor to an unsupported MacBook?

No. It is a physical component. If your Mac does not have one, or does not expose it to macOS, no application can create the measurement — and Mac Duo says exactly that when it cannot find one rather than falling back to a timer.

Does an accelerometer replace the lid-angle sensor?

No, and Mac Duo will not accept one. An accelerometer describes motion and orientation of the whole machine, not the angle between two halves of it. The check the app applies is about what a sensor actually reports, so a motion sensor does not pass it.

How can I check whether my Mac exposes the required sensor?

There is a one-line, read-only Terminal command on the compatibility page. It installs nothing and changes nothing. A device listed is a good sign; nothing listed is a strong signal but not the last word, because the app looks more broadly than one command can.

Does Mac Duo track the lid continuously?

It reads the angle while the lid is moving, and that reading never leaves your Mac. Screen capture runs only during movement and stops about a second and a half after the lid settles. There is no analytics and no account system, and nothing about your lid or your screen is sent anywhere.

Try it on your own lid

£2.99 once, on up to 5 Macs, with no account and no licence key. Mac Duo needs a compatible continuous lid-angle sensor, so please check compatibility before purchasing. The compatibility guarantee is on that page.