MacBook Lid Angle Sensor
GitHub Repo

MacBook Lid Angle Sensor

@the_ospsPost Author

Project Description

View on GitHub

Unlock a New Sensor on Your MacBook: The Lid Angle Sensor

Ever wished your MacBook could do something a little smarter when you open or close its lid? Maybe trigger a specific app when you start work or put itself in a more focused "do not disturb" mode when you're just cracking it open to check something quickly. What if you could use the precise angle of the lid as a trigger for automations?

That's exactly what developer Sam Henri-Gold explored with a clever little project. It turns out your MacBook has a hidden sensor that's just begging to be used for more than just sleep and wake.

What It Does

The Lid Angle Sensor project is a macOS menubar app that taps into a built-in sensor, the Hall Effect sensor, to read the precise angle of your MacBook's lid in real-time. While macOS uses this sensor in a binary way (open/closed for sleep/wake), this tool unlocks the continuous data stream, giving you a live degree reading between 0° (closed) and 180° (fully open).

Why It's Cool

The genius here is in the simplicity and the hackability. This isn't some complex external hardware setup; it's a direct software interface with existing, underutilized hardware. The project provides a clean Swift package (LidAngle) that any developer can drop into their own macOS project, plus a ready-to-use menubar app to see it in action immediately.

The potential use cases are what make it truly exciting:

  • Context-Aware Workflows: Automatically switch audio outputs based on lid angle (e.g., internal speakers at 90°, external speakers when fully open at 180°).
  • Dynamic Do Not Disturb: Mute notifications when the lid is only slightly open, signaling a quick check rather than a deep work session.
  • Creative Controls: Use the lid as a physical control surface for music or video editing software by mapping the angle to a parameter like volume or brush size.

It’s a fantastic example of finding new utility in the hardware we already have.

How to Try It

Getting started is straightforward for any Mac developer.

  1. Check Compatibility: This works on MacBook Pros (14-inch and 16-inch, 2021 and later) and MacBook Airs (13-inch and 15-inch, M2 and later).
  2. Grab the App: Head over to the Releases page on GitHub, download the latest LidAngleSensor.zip, and unzip it. Drag the app to your Applications folder and run it. You'll see a live angle reading right in your menubar.
  3. Use the Swift Package: For developers, the core functionality is available as a Swift package. Just add https://github.com/samhenrigold/LidAngle to your Xcode project and start reading the lid angle in your own code.

You can find the full source code, the Swift package, and contribution guidelines on the GitHub repository.

Final Thoughts

This is one of those projects that feels like a feature that should have always been there. It’s a small, focused tool that demonstrates a powerful idea: sometimes the most interesting innovations come from looking at the existing components of our devices in a new light. It’s not about building something massive from scratch, but about creatively connecting the dots that are already there.

For developers, it’s a great inspiration for hardware hacking and creating more intuitive, context-aware applications. I’m excited to see what kind of clever automations and tools the community builds on top of this concept.

Follow us for more cool projects: @githubprojects

Back to Projects
Project ID: 1964549688562241812Last updated: September 7, 2025 at 04:42 AM