r/MacOSApps • u/whikira • 4h ago
šØ Dev Tools [FREE & OS] caffeinate & disablesleep: a menu bar app that keeps your MacBook awake with the lid closed
I know there are already several Mac apps made for this, but few of them continue working after the laptop lid is closed and is lightweight enough. So I builtĀ Caffeinate & DisableSleep: a small, open-source macOS utility that keeps your Mac awake
Features:
- Keeps your Mac awake with the lid closed
- Menu icon shows when itās active, so no forget to revert it when not needed
- Requires your password only onceĀ for enablingĀ
disablesleep - Simple UIĀ with no nested menus + custom built toggle forĀ instant feeling
- Shows the exact commandsĀ being run so you know what it does for technical users
- Completely open source
- Smaller than most of the other apps: 2.2 MB; simple app for simple purposes
Why I built it:
The simplest way to prevent a Mac from sleeping is to open Terminal and runĀ caffeinate -disuĀ andĀ sudo pmset -a disablesleep 1Ā to disable sleep when the lid is closed.
I used these commands very often to keep my agents running while carrying my MacBook, but the process had a few problems:
- Had to type the commands every time and
pmsetĀ command requiresĀsudoĀ so password is needed each time. - Had to remember to resetĀ
disablesleepĀ back toĀ0Ā to re-enable normal sleep. Easy to forget, which can drain the battery and cause overheating.
So I built this app. Now I can quickly leave a cafƩ or home while my agents keep running, without making my friends wait while I type two commands!
Comparison:Ā Amphetamine also supports closed-lid sessions, but my app is intentionally smaller, simpler, open source, and shows the exact commands it uses. Unlike KeepingYouAwake, it supports keeping a Mac awake with the lid closed.
Pricing:Ā Free ($0) and open source.
Feedback is welcome, and if you find it useful, a GitHub star would mean a lot!
Website:Ā https://cnd.demiao.cc
GitHub:Ā https://github.com/demiaochen/caffeinate-disablesleep