LidAwake app icon: a white coffee cup on a brown gradient

LidAwake.

Keep your Mac awake with the lid closed. Your builds, downloads, and agent sessions survive. Brightness comes back exactly where you left it.

curl -fsSL https://raw.githubusercontent.com/deezeddd/LidAwake-Mac/main/install.sh | bash
Star on GitHub GitHub stars
LidAwake menu open in the macOS menu bar with the filled coffee cup icon and Keep Awake When Lid Is Closed checked
Filled cup = your Mac stays awake with the lid closed.

Why you'll like it

โ˜•

One-click toggle

A coffee cup in the menu bar. Click to keep the Mac running lid-closed, click to go back to normal sleep.

๐Ÿ”†

Brightness memory

Saves your screen brightness when the lid closes and restores the exact level when you reopen.

๐Ÿชถ

Genuinely tiny

About 200 lines of native Swift. No Electron, no daemons, a few MB of RAM, no network access.

๐Ÿ”

Fully auditable

The whole app is one readable source file, MIT licensed. The installer builds it on your own machine.

๐Ÿš€

Start at Login

One menu item, using Apple's own login items API. Set it once and forget the app exists.

๐Ÿ“œ

Honest logging

Every lid and brightness event is logged locally, so you can always see exactly what it did.

How it works

  1. Sleep toggle: flips Apple's supported pmset disablesleep power flag through a sudoers rule scoped to exactly two commands. No kernel extensions, no hacks.
  2. Lid detection: macOS fires no display-sleep event on lid close; it disconnects the built-in display. LidAwake polls AppleClamshellState on IOPMrootDomain instead.
  3. Brightness: saved and restored via the DisplayServices framework, the same API used by MonitorControl.
โš ๏ธ While the toggle is on, your Mac will not sleep at all, even on battery inside a bag. The filled cup is your reminder to switch it off before you pack up.