A lightweight macOS menu bar app that keeps your Mac awake — no sleep, no screen dimming.
Like Lungo, Caffeine, and Amphetamine, but simpler.
brew tap marcelotrevisani/tap
brew install --cask cafezimDownload the latest .dmg from Releases, open it, and drag Cafezim.app to your Applications folder.
Note: The app is not notarized yet. If macOS says the app is "damaged", run:
xattr -cr /Applications/Cafezim.app
- Prevents your Mac from sleeping and the display from turning off
- Lives in the menu bar with a coffee cup icon (filled when active)
- Timer support: keep awake for 30min, 1h, 2h, 4h, 8h, or a custom number of hours
- Indefinite mode (default) — stays awake until you deactivate it
- Zero configuration, no Dock icon, minimal resource usage
- Uses native macOS IOKit power assertions (
IOPMAssertionCreateWithName)
- macOS 13 (Ventura) or later
- Xcode 15+ (for building)
- just (optional, for convenience commands)
# Debug build
just debug
# Release build
just release
# Build .app bundle (release by default)
just app
# Build .app bundle in debug mode
just app debug
# Build DMG installer
just dmg v0.1.0# Debug build
swift build
# Release build
swift build -c release
# Build .app bundle
./scripts/build-app.sh release
# Build DMG
./scripts/build-dmg.sh v0.1.0The built artifacts will be located at:
- Debug binary:
.build/debug/Cafezim - Release binary:
.build/release/Cafezim - App bundle:
build/Cafezim.app - DMG:
build/Cafezim-<version>.dmg
just runThis builds in debug mode and launches the app in the background.
# Debug
swift build && .build/debug/Cafezim &
# Release
swift build -c release && .build/release/Cafezim &
# From .app bundle
open build/Cafezim.appOnce running, look for the coffee cup icon in your menu bar.
just testswift testNote: Tests require the full Xcode installation (not just Command Line Tools). If you see
no such module 'XCTest', run:sudo xcode-select -s /Applications/Xcode.app/Contents/Developer
# Format all Swift files
just format
# Pre-commit hook (auto-formats on commit)
brew install pre-commit swiftformat
pre-commit installCafezim uses macOS IOKit power assertions to prevent sleep:
kIOPMAssertionTypeNoDisplaySleep— prevents both system sleep and display sleep- When a timer is set, the assertion is automatically released when time expires
- Deactivating (or quitting) immediately releases the assertion
cafezim/
├── Package.swift # Swift Package Manager config
├── justfile # Build/run/test shortcuts
├── Cafezim/
│ ├── Sources/
│ │ └── CafezimApp.swift # App entry point, menu bar setup
│ └── Resources/
│ ├── Info.plist # App bundle metadata
│ └── Entitlements.plist # App entitlements
├── CafezimCore/
│ └── Sources/
│ ├── SleepManager.swift # IOKit power assertion logic
│ └── MenuBarView.swift # SwiftUI menu bar UI
├── CafezimTests/
│ ├── SleepManagerTests.swift # Core logic tests
│ └── MenuBarViewTests.swift # UI model tests
├── scripts/
│ ├── build-app.sh # Builds Cafezim.app bundle
│ ├── build-dmg.sh # Packages .app into a .dmg
│ └── create-icns.sh # Generates .icns from SVG logo
└── .github/
└── workflows/
├── ci.yml # CI: build + test on push/PR
└── release.yml # Release: DMG + Homebrew tap update
Releases are automated via GitHub Actions. When you publish a new release:
- Tag your commit:
git tag v0.1.0 && git push origin v0.1.0 - Create a GitHub release from the tag
- The pipeline automatically:
- Runs tests
- Builds
Cafezim.appand packages it into a.dmg - Uploads the
.dmgto the GitHub release - Updates the Homebrew cask formula in your tap repo
-
Create the tap repo:
gh repo create homebrew-tap --public
-
Create a fine-grained PAT with Contents: Read and write on
homebrew-tap -
Add it as a secret:
gh secret set HOMEBREW_TAP_TOKEN
MIT