Loading page...Загружаем страницу...正在加载页面...
AtlasRepo

Close Your MacBook Lid Without Killing Your AI Agents (Open-Source macOS Keep-Awake)

Описание и применение

Awake позволяет продолжать работу MacBook с закрытой крышкой, блокируя экран и автоматически отключая сон при перегреве или низком заряде батареи.

Задача

Closing a MacBook lid on battery or unplugged causes macOS to enter clamshell sleep, dropping SSH sessions, freezing Docker builds, and killing background AI coding agents.

Результат

Awake enables continuous operation with the lid closed, protects against overheating and low battery, and maintains security by locking the screen.

Рабочий процесс

  • 1. Install Awake via script or Homebrew.
  • 2. Run awake 2h to keep the Mac awake for 2 hours, or awake -- bun run build to keep awake until a command finishes.
  • 3. Awake toggles pmset -a disablesleep 1 and caffeinate -dims while monitoring AppleClamshellState.
  • 4. On lid close, Awake locks the screen immediately.
  • 5. Awake polls AppleSmartBattery every 30s; if temperature ≥40°C or charge ≤10%, it trips a breaker, allows sleep, and auto-resumes when conditions normalize.

Доказательства

Every time you close your MacBook lid on battery or unplug your display to walk to a meeting, macOS enters clamshell sleep. Your SSH sessions drop, your Docker builds freeze, and your background AI coding agents die mid-run.

Источник

So I built and open-sourced Awake — a tiny native macOS 26 Control Center widget, Menu Bar timer, and CLI that keeps your MacBook running with the lid closed, locks the screen the instant the lid shuts, and automatically re-enables sleep if the battery temp hits 40°C or drops to 10%.

Источник

  • Дата записи: 2026-11-03T18:13:48.554Z