Building Linger: A Featherlight macOS Desktop Lyrics Overlay in Swift 6, Metal, and XDR HDR

Engineering notes from shipping Linger 1.0 for macOS: album-sampled Metal aurora shaders, XDR HDR current-line luminance, debugging a 64-thread GCD pool deadlock in AppKit window animations, and popup-free silent updates.

On this page
  1. 1. Album-sampled Metal aurora, XDR HDR luminance, and edge dissolve
  2. 2. Debugging a multi-day hang: AppKit window animations exhausting the 64-thread GCD pool
  3. 3. Popup-free silent updates and an in-app changelog
  4. 4. Zero-fixed-cost licensing and instant self-service refunds

When I have music playing while writing code or reading docs, I like having synced lyrics tucked quietly into a corner of the screen. Looking around on modern macOS, most options fell into one of two camps: older open-source tools that haven’t kept pace with recent macOS releases, or heavy windows that block mouse clicks, steal focus, or ask for a monthly subscription.

All I wanted from a desktop lyrics companion was restraint: under 3% CPU while playing and ~0% when paused, full mouse click-through, colors that breathe naturally with the current album art, and a gentle exit when the music stops.

Over the past month I built Linger from scratch in Swift 6 (strict concurrency) and Metal to do exactly that. Now that v1.0 is live, here are a few engineering details and bugs from along the way.

1. Album-sampled Metal aurora, XDR HDR luminance, and edge dissolve

Blurring raw album art directly behind text looks great on curated screenshots and falls apart the moment a pure-white or neon cover comes on.

Instead, Linger extracts a three-stop palette from each cover with guaranteed contrast floors, then feeds those colors into a custom Metal fragment shader (Aurora.metal) driven by slow, low-frequency noise fields. Track changes cross-fade smoothly into the new album’s mood without sacrificing legibility.

On MacBook Pro XDR and Pro Display XDR screens, Linger also supports optional Extended Dynamic Range (EDR / HDR) highlights on the active line and syllable sweep: the backdrop stays anchored in SDR while the currently sung words step gently into HDR headroom, creating depth without cranking up font size.

When you pause playback, the card dissolves inward from its edges rather than blinking off abruptly, and gathers back when you hit play. Paired with Desktop-level pinning (above your wallpaper, behind app windows) or Always-on-Top click-through (ignoresMouseEvents plus fade-on-hover), it stays completely out of the way of your cursor.

2. Debugging a multi-day hang: AppKit window animations exhausting the 64-thread GCD pool

The hardest bugs in menu bar utilities are the ones that only show up after three days of uptime. During 0.9 dogfooding, Linger occasionally froze solid after running continuously for several days.

Sampling the hung process revealed something surprising: all 64 threads in libdispatch’s worker pool were blocked, starving the main thread whenever anything waited on a background queue. Every one of those wedged worker threads was parked inside AppKit’s private _NSWindowTransformAnimation—opening and closing utility windows over days of uptime occasionally leaked a blocking animation thread until the 64-thread cap was exhausted.

Once identified, the fix was two lines and an architectural cleanup: scoping NSAutomaticWindowAnimationsEnabled = false to the app’s defaults and moving all artwork decoding onto non-blocking async tasks. Multi-day uptime has been rock solid ever since.

3. Popup-free silent updates and an in-app changelog

Few things break flow faster than an updater modal jumping in front of your editor mid-thought.

In v1.0.2, I customized Sparkle 2’s SPUStandardUserDriverDelegate so scheduled background checks never present modal alerts or steal focus:

  • Updates are downloaded and verified (Ed25519 + Apple Developer ID) silently in the background.
  • Because users rarely quit menu bar apps, staged updates apply either on normal quit or automatically during a calm two-minute idle window when no music is playing and no Linger windows are open.
  • After updating, Linger still doesn’t pop up a window—it lights up a subtle What’s new badge inside Settings with a categorized NEW / IMPROVED / FIXED timeline (and an Automatic updates switch if you prefer manual control).

4. Zero-fixed-cost licensing and instant self-service refunds

Because reading system-wide playback state outside sandboxed APIs requires direct distribution, Linger ships as an Apple-notarized Universal DMG (arm64 + x86_64 for macOS 14+).

The commerce backend runs at $0/month fixed cost on Cloudflare Workers, D1, and edge rate limiters in front of Stripe Checkout (with 3D Secure enforced):

  • 14-day full-featured free trial out of the box—no account, no credit card.
  • $4.99 USD one-time purchase for up to 3 Macs (with self-service device deactivation to move slots anytime). Activated licenses are signed server-side with Ed25519 and verified offline from your local Keychain.
  • 14-day instant self-service refund: enter your license key and purchase email on the refund page, and Stripe issues a full refund automatically without waiting on support emails.

If you listen to Apple Music or Spotify while working on a Mac, you can try the interactive WebGL + synthesized-audio playground right in your browser or grab the 14-day trial: