v1.3.0 โ€” Now Available

Keep Your Mac
Awake

Close the lid. Display sleeps. System stays alive. Pure Swift, near-zero memory, no Electron.

$ brew tap 3289david/tap && brew install nonsleep
Copied!
$ git clone ... && cd nonsleep && make install
Copied!
$ npm install -g nonsleep
Copied!

Three Simple Steps

NonSleep intercepts the lid close event. The display turns off, but the system never sleeps.

๐Ÿ’ป
Lid Closes
Event detected
โ†’
๐Ÿ”ด
Display Off
Screen sleeps
โ†’
โšก
System Alive
IOKit assertion
โ†’
๐Ÿ”“
Lid Opens
Display restored

Tiny by Design

One job. Done perfectly.

๐Ÿ–ฑ

Menu Bar

One-click toggle from your menu bar. Green means on, gray means off. Nothing more.

โŒจ๏ธ

CLI

Full terminal control. nonsleep to enable, nonsleep stop to disable.

๐ŸŒ™

Lid-Aware

Detects lid state in real-time. Sleeps display on close, wakes on open. Automatic.

โšก

Native

Pure Swift + IOKit. Under 2 MB. Near-zero CPU. No Electron, no background web views.

โฑ

Temporary Mode

Run nonsleep for 2h to auto-disable after a set duration.

๐Ÿ”„

Synced

Menu bar, CLI, and daemon stay perfectly in sync through a shared state file.

Interactive Demo

Click the moon icon in the menu bar.

NonSleep
Wi-Fi
100%
๐ŸŒ™
3:42 PM
โœ“
Disable Sleep
ON
Quit NonSleep
โŒ˜Q

Terminal First

Every feature accessible from your terminal.

nonsleepEnable sleep prevention
nonsleep stopDisable
nonsleep statusShow current state
nonsleep toggleFlip ON/OFF
nonsleep for 2hTemporary mode
nonsleep for 30mHalf hour timer
Terminal
$ nonsleep status
โ— NonSleep: ON
Lid: open

$ nonsleep for 2h
โ— NonSleep enabled for 2h 0m
Press Ctrl+C to stop early.

How It's Built

Three components, one shared core, zero bloat.

Menu Bar App
SwiftUI
CLI Tool
ArgumentParser
Daemon
launchd
โ†“   โ†“   โ†“
NonSleepCore
PowerManager ยท LidWatcher ยท StateManager
โ†“
state.json
~/Library/Application Support/NonSleep/

Get NonSleep

macOS 13.0+ · Apple Silicon & Intel · Under 1 MB