- Native macOS menu bar app named Focus.
- Counts focused time in seconds and can be started/stopped via a global shortcut.
- Menu bar shows only the elapsed time (no icon, no app name).
- Language: Swift
- UI: SwiftUI (menu bar only; no custom windows)
- Libraries: AppKit, Carbon, ServiceManagement
- Target: macOS 26
- Bundle ID:
com.erazemk.Focus - No Xcode UI; terminal-only workflow.
- No code signing or distribution required (local
.apponly).
- Standard menu with:
- Start (Cmd+S)
- Stop (Cmd+S)
- Quit (Cmd+Q)
- Start/Stop share Cmd+S:
- If stopped: Start enabled, Stop disabled, Cmd+S starts.
- If running: Stop enabled, Start disabled, Cmd+S stops.
- Quit always enabled.
- System-wide hotkey:
Ctrl + Option + Ftoggles start/stop. - Use standard global hotkey registration approach (may prompt for permissions).
- App attempts to auto-enable launch at login on startup.
- There is no UI for toggling this behavior.
- Display format:
1s..59s1m, 1m 1s .. 59m 59s1h, 1h 1s, 1h 59s, 1h 1m, ...
- Max: under 24 hours (no days).
- Stopped state keeps last elapsed time visible.
- Stopped → started resets to 0 and begins counting.
- No persistence/history beyond the current session.
- Automatically stopped if the screen is locked
- Always build this project via the
Makefile; do not invokeswift builddirectly. - Only use
make build. Do not runmake installunless the user explicitly asks. - SwiftPM project rooted at
src/. make buildwill:- run
swift build --package-path src --scratch-path .build -c release - assemble
.appinside.build/Focus.app
- run
- App icon:
AppIcon.icnsis used viaCFBundleIconFile.- Copied into
.app/Contents/Resources/.