Keep your Mac awake with the lid closed. A lightweight alternative to Amphetamine / Caffeine, built on pmset disablesleep.
SleepControl.app is a modern native macOS utility built with Swift + SwiftUI + AppKit + IOKit. It seamlessly bridges sudo pmset -a disablesleep 1 (preventing system and clamshell sleep) and sudo pmset -a disablesleep 0 (restoring default energy conservation) into an elegant, lightweight desktop app.
English (en) |
Simplified Chinese (zh-Hans) |
|---|---|
![]() |
![]() |
English (en) |
Simplified Chinese (zh-Hans) |
|---|---|
![]() |
![]() |
-
One-Click Toggle & Real-Time Status Synchronization
- Live telemetry monitoring of
SleepDisabledvia/usr/bin/pmset -g, display sleep timer, system sleep mode, and battery status. - Seamless toggling between sleep allowed and sleep disabled from either the Menu Bar Popover or the standalone Bento Dashboard Window.
- External CLI changes (e.g., executing
pmsetin Terminal) are automatically synchronized in real time.
- Live telemetry monitoring of
-
Smart AC Power Automation (Zero-Polling Hardware Events)
- Monitors AC/Battery power transition events in real time using macOS
IOKit.ps(IOPSNotificationCreateRunLoopSource) with zero CPU polling overhead. - When "Auto Disable Sleep on AC" is enabled:
- Connected to AC Power: Automatically executes
sudo pmset -a disablesleep 1(keeps Mac awake even when the lid is closed). - Switched to Battery Power: Automatically restores
sudo pmset -a disablesleep 0(preserves battery life).
- Connected to AC Power: Automatically executes
- Monitors AC/Battery power transition events in real time using macOS
-
One-Click Passwordless Sudo Authorization (Safe
visudoVerification)- Built-in one-click setup to configure passwordless execution exclusively for
/usr/bin/pmset. - Requires administrator authentication only once via macOS native Touch ID / Password prompt.
- Safely verified using
/usr/sbin/visudo -cfbefore writing to/etc/sudoers.d/mac_sleep_control(permissions0440). - All subsequent toggles and power-event triggers execute silently in milliseconds without intrusive password dialogs. Can be revoked at any time.
- Built-in one-click setup to configure passwordless execution exclusively for
-
Multi-Language Support (i18n)
- Fully localized across 5 languages:
- English (
en) (Default fallback) - Simplified Chinese (
zh-Hans) - Traditional Chinese - Taiwan (
zh-Hant-TW) - Traditional Chinese - Hong Kong (
zh-Hant-HK) - Japanese (
ja)
- English (
- Supports instant runtime language switching from the menu bar or dashboard without requiring an application restart.
- Fully localized across 5 languages:
-
Clean Dock & Menu Bar Integration
- Compact 22pt status bar icon with
⌘ Command + Dragposition reordering. - Automatically hides from the Dock (
.accessoryactivation policy) when the main dashboard is closed, maintaining a clutter-free workspace while running silently in the background. - Re-summon the dashboard anytime via the Menu Bar Popover, Dock click, or Finder.
- Compact 22pt status bar icon with
- Download the latest
SleepControl-*.zipfrom the Releases page. - Unzip it and drag
SleepControl.appinto your/Applicationsfolder. - First launch (Gatekeeper): the app is ad-hoc signed (not notarized), so macOS may block it on first launch. Either:
- Right-click
SleepControl.app→ Open → Open, or - Run in Terminal:
xattr -dr com.apple.quarantine /Applications/SleepControl.app
- Right-click
Requirements: macOS 14.0 (Sonoma) or later, Apple Silicon or Intel.
On first use, click Configure in the app to enable passwordless sudo for /usr/bin/pmset (one-time Touch ID / password prompt). After that, all toggles and AC automation run silently.
- In the app, click Revoke to remove the passwordless authorization (or manually delete
/etc/sudoers.d/mac_sleep_control). - Quit the app and delete
SleepControl.app.
- macOS 14.0 (Sonoma) or later
- Xcode 15.0+ or Swift 5.10+ command line tools
Clone the repository and run the automated build script:
git clone https://github.com/himanzero/macos-sleep-control.git
cd macos-sleep-control
./build_app.shThe script compiles the release binary, creates the iconset, packages the .app bundle with all localization .lproj directories, and applies an ad-hoc codesign signature.
# Launch the app directly
open SleepControl.app
# Or copy to Applications
cp -R SleepControl.app /Applications/SleepControl is completely open-source and respects your system integrity:
- No Network Telemetry: Zero data collection, tracking, or network requests.
- Scoped Privilege Boundary: Passwordless sudoers configuration is strictly scoped to
/usr/bin/pmsetwith read/write protections and syntax validation. - Safe Sandboxing of Settings: Preferences are stored locally in standard
UserDefaults.
Issues and pull requests are welcome! Please open an issue to report bugs or suggest features.
This project is open-source software licensed under the MIT License.



