← all work

MacFold

A menu bar app that folds the Mac's screen shut as you close the lid and unfolds it when you open it, like a foldable phone - five styles, from an iPhone Duo tilt to liquid glass and a 3D book fold.

Type
Personal Project · macOS / Graphics
Year
2026–now
Role
Sole developer - sensor, rendering and app.

Follows the real hinge angle from the lid sensor frame by frame, so the fold moves with your hand - and a watchdog makes sure a black overlay can never get stuck on screen.

  • Driven by the real lid angle
  • Five fold styles, incl. liquid glass
  • Unfolds with a spring on wake

The problem

Closing a laptop is a dead moment - the screen just cuts to black. Foldable phones showed that the fold itself can feel good.

Make the lid itself the controller: the screen folds exactly as far as the lid is closed, and springs open on wake.

What I did

  1. Read the hinge angle straight from the Mac's lid sensor over IOKit HID and mapped it to each style's start and end angle.
  2. Rendered the styles with Core Animation and Core Image - a perspective-projected sheet with depth blur, a barrel-lens warp, layered liquid glass and 3D hinges.
  3. Captured the real screen underneath with ScreenCaptureKit, with a wallpaper fallback, and built a state machine for lid, sleep, wake and unlock.

Outcome

A working menu bar app with five fold styles that track the lid live, plus previews and an offscreen render mode for frames.

Stack

  • Swift
  • AppKit
  • Core Animation
  • Core Image
  • Metal
  • ScreenCaptureKit
  • IOKit
Next caseVault RAG Agent

© Johan Stefanesback home

Get in touch
Still building this site