CaffBar is a polished macOS menu bar utility that controls /usr/bin/caffeinate with one-click presets, custom duration components, and a small set of clear sleep-prevention mode toggles.
It runs as a menu bar agent (no Dock icon) and keeps the UI focused on the common workflows:
- quick presets (
15m,1h,3h,8h, infinity) - custom duration using day/hour/minute/second components
- core
caffeinatemode flags (-d,-i,-s,-u) - optional advanced controls (
-m, attach to PID via-w)
- Menu bar icon stays fixed in width and switches between idle and active cup states
- Remaining time is shown inside the menu panel and in the status item's hover text, including
∞for indefinite runs - Presets start immediately without changing the primary
Start Sessionaction - The primary
Start Sessionaction always uses the current duration components (0 = infinity) - Advanced options are collapsed by default to keep the main menu uncluttered
cd caffbar
open CaffBar.xcodeprojcd caffbar
xcodebuild -project CaffBar.xcodeproj -scheme CaffBar -configuration Debug buildMinimum target is macOS 14.0.
This repo uses native Git hooks (not Husky) to validate the Xcode project locally before each commit.
cd caffbar
./scripts/setup-git-hooks.shThis configures:
core.hooksPath = .githooks- a
pre-commithook that runs./scripts/validate-local.sh
- Docs-only commits (
README,docs/,LICENSE,.gitignore) skip build validation - Tooling/workflow changes (
scripts/,.githooks/,.github/workflows/) run fast checks:Info.plist/project.pbxprojsyntax- workspace/scheme XML syntax (if
xmllintis installed) - shell script syntax (
bash -n) - release workflow YAML parse (
ruby)
- Swift/Xcode project changes (
CaffBar/,CaffBar.xcodeproj/) run full validation:- fast checks above
xcodebuild -list- Debug build for macOS destination
CAFFBAR_SKIP_HOOKS=1 git commit -m "your message"./scripts/validate-local.sh --fast
./scripts/validate-local.sh --fullMARKETING_VERSION in CaffBar.xcodeproj/project.pbxproj is the version source of truth.
cd caffbar
./scripts/package.shThis produces:
dist/CaffBar-<version>.zipdist/CaffBar-<version>.dmg
The script prints SHA-256 hashes for both artifacts.
Homebrew continues to use the ZIP release artifact.
Tap repo: akalp/homebrew-caffbar
brew install --cask akalp/caffbar/caffbarAlternative:
brew tap akalp/caffbar
brew install --cask caffbarGitHub releases publish both a ZIP and a DMG.
For a manual install using the DMG:
- Open
CaffBar-<version>.dmg - In the
Install CaffBarwindow, dragCaffBar.appintoApplications - Launch CaffBar from
Applications
Unsigned builds and DMGs are expected by default. If macOS blocks a manual install, try right-clicking the app and choosing Open, or remove quarantine:
xattr -dr com.apple.quarantine /Applications/CaffBar.app- Confirm
/usr/bin/caffeinateexists (standard on macOS) - Stop an existing CaffBar session and try again
- If using
Attach to process (-w), verify the PID is a positive integer
These screenshots are generated from the SwiftUI preview states in CaffBar/PreviewSupport/MenuPanelPreviews.swift.


