Tiny menu bar caffeinator for macOS. ~90 lines of Swift. One click to keep your Mac awake. No settings, no telemetry, no fluff.
Cafinat sits in your menu bar as a coffee cup. Click it once — your Mac will not sleep, dim, or run the screensaver. Click again — back to normal. Right-click for status / quit.
Under the hood it's a thin wrapper around macOS's built-in caffeinate -di command, with a self-watchdog flag (-w $$): if Cafinat ever crashes or is force-quit, the underlying caffeinate dies with it. No orphan processes.
| Tool | Status | Code size | Notes |
|---|---|---|---|
| Caffeine (original) | abandoned 2014 | unknown | doesn't work on modern macOS |
| Amphetamine | active, App Store | large | feature-rich, requires App Store account, ad-style upsells |
| KeepingYouAwake | active, open source | ~5,000 LoC Obj-C | great app, larger codebase |
| Lungo | $4.99 | closed | paid |
| Cafinat (this) | active, open source | ~90 LoC Swift | minimum viable caffeinator |
This is the smallest auditable caffeinate menu bar app I'm aware of. If you want a feature dashboard with timers, schedules, and triggers — use Amphetamine. If you want something you can read end-to-end in 5 minutes, build yourself, and trust — Cafinat.
- Download
Cafinat-*.dmgfrom the latest release. - Open the
.dmg, dragCafinat.apptoApplications. - First launch: the app isn't notarized (notarization needs the $99/yr Apple Developer fee). macOS Gatekeeper will block it. Right-click
Cafinat.app→ Open → confirm. After that, double-click works normally. - Cafinat appears as a coffee cup ☕ in your menu bar.
git clone https://github.com/alexxety/cafinat.git
cd cafinat
bash build.sh
open build/Cafinat.appRequirements: macOS 13+, Xcode Command Line Tools (xcode-select --install).
| Action | Result |
|---|---|
| Left-click the menu bar icon | Toggle caffeinate on/off |
| Right-click | Show status (Active/Inactive) and Quit |
| Filled cup ☕️ | Active — Mac stays awake |
| Outlined cup | Inactive — normal sleep behavior |
That's the whole UI. There are no preferences, no accounts, no hotkeys, no notifications.
Cafinat uses NSStatusItem to put a cup icon in the menu bar. When you click it, it spawns /usr/bin/caffeinate -di -w $cafinat_pid:
-d— prevents the display from sleeping-i— prevents the system (idle) from sleeping-w $$— caffeinate exits when the watched PID (Cafinat itself) exits
When you click again or quit Cafinat, the caffeinate process is terminated. If Cafinat crashes, -w ensures caffeinate cleans itself up.
The status icon switches between two SF Symbols:
cup.and.saucer(outlined) — inactivecup.and.saucer.fill(filled) — active
That's it. Read the source: Cafinat/AppDelegate.swift — under 100 lines.
There's no built-in setting. Use macOS native:
System Settings → General → Login Items & Extensions → + → add Cafinat.app.
No. It needs to spawn /usr/bin/caffeinate as a child process, which a sandboxed app cannot do reliably. There's no network access, no file I/O outside the bundle, no entitlements requested.
No. NSStatusItem, NSMenu, Process, NSImage(systemSymbolName:) — all public AppKit / Foundation.
App Store requires a $99/year Apple Developer account. This is a free side project. PRs welcome to ship on the App Store if anyone wants to maintain that.
Historical — the project started as a placeholder bundle ID. Changing it after release would break upgrade paths for early users, so we kept it.
caffeinate -di keeps the display on, which is the main battery cost. Only use it when you actually need the Mac awake (presentations, downloads, long compiles). When inactive, Cafinat itself idles at near-zero CPU.
PRs welcome. See CONTRIBUTING.md. Common things that would help:
- Localized tooltips (right-click menu)
- Optional auto-stop after N minutes
- Homebrew Cask (
brew install --cask cafinat) - Apple Developer ID notarization sponsorship
MIT — use, fork, ship inside other projects, no strings.
Keywords for search engines: macos caffeinate menu bar, prevent mac from sleeping, keep mac awake free, caffeine alternative mac, amphetamine alternative, minimal menu bar app, swift menu bar caffeinator, macos display sleep prevention, mac stay awake utility, caffeinate gui, prevent screensaver mac, presentation mode mac, no sleep mac app.