
Quietly tracks how long your Mac stays locked — and how long you stay focused between unlocks.
12:57 → 13:48)| Command | Type | Description |
|---|---|---|
| Lock Stats | View | View today's lock time statistics |
| Update Lock State | Background | Automatically detects and updates lock state every 60 seconds |
| Lock Time Menu Bar | Menu Bar | Shows today's cumulative lock time in the menu bar |
Lock Time checks your Mac's lock state every 60 seconds using a multi-level detection strategy:
CGSSessionScreenIsLocked field. No extra permissions needed. Most reliable on macOS 13+.loginwindow or ScreenSaverEngine.If detection fails, the extension preserves the last known state rather than guessing.
View today's lock time statistics
Background command to detect and update lock state
Show lock time in menu bar
12:57 → 13:48)LockSession data structure (lockAt / unlockAt / durationMs) and extended MetricsData with session tracking fieldsformatTime() / formatTimeRange() formatting utilitiesSessionDetailView component with Action.Push drill-down interactionuseLockData Hook: display cached data first, detect in backgrounddetectLockStateWithInfo(): added 5-second detection result cache with skipCache paramprocessStateChange(): parallelized LocalStorage read/write, conditional writes reduce unnecessary I/OCFDictionary, causing CGSSessionScreenIsLocked field to be lostCGSessionCopyCurrentDictionary() call for reliable bridginguseLockData() now executes processStateChange() on first loadfs.appendFileSync() to prevent async log loss