Skip to content

Commit d0ccd3f

Browse files
committed
feat: user idle detection (macOS/Windows), version bump to 5.0.3
Skip blackout triggers when no mouse/keyboard input for 5 minutes. macOS: CGEventSource idle time. Windows: GetLastInputInfo API. watchOS complication purple yin-yang fix included.
1 parent 1b478fe commit d0ccd3f

11 files changed

Lines changed: 264 additions & 147 deletions

File tree

Awareness.xcodeproj/project.pbxproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,7 @@
455455
CURRENT_PROJECT_VERSION = 1;
456456
DEVELOPMENT_TEAM = FDSVBU33S8;
457457
INFOPLIST_FILE = SupportFiles/Info.plist;
458-
MARKETING_VERSION = 5.0.2;
458+
MARKETING_VERSION = 5.0.3;
459459
PRODUCT_BUNDLE_IDENTIFIER = com.joergsflow.awareness.ios;
460460
PRODUCT_NAME = "$(TARGET_NAME)";
461461
SWIFT_EMIT_LOC_STRINGS = YES;
@@ -471,7 +471,7 @@
471471
CURRENT_PROJECT_VERSION = 1;
472472
DEVELOPMENT_TEAM = FDSVBU33S8;
473473
INFOPLIST_FILE = SupportFiles/Info.plist;
474-
MARKETING_VERSION = 5.0.2;
474+
MARKETING_VERSION = 5.0.3;
475475
PRODUCT_BUNDLE_IDENTIFIER = com.joergsflow.awareness.ios;
476476
PRODUCT_NAME = "$(TARGET_NAME)";
477477
SWIFT_EMIT_LOC_STRINGS = YES;

CHANGELOG.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,13 @@ All notable changes to Atempause (formerly Awareness reminder), from initial rel
44

55
---
66

7-
## v5.0.2
7+
## v5.0.3
8+
9+
### User Idle Detection (macOS + Windows)
10+
- **Skip breaks when away** — if no mouse/keyboard input for 5 minutes, blackout triggers are silently skipped (user is not at the screen)
811

912
### watchOS Complication Fix
10-
- **Purple yin-yang complication** — watchOS complication now shows a proper two-tone purple yin-yang instead of monochrome; uses original rendering mode with purple-tinted transparent-background PNG
13+
- **Purple yin-yang complication** — watchOS complication now shows a proper two-tone purple yin-yang instead of monochrome
1114

1215
---
1316

Sources/Awareness/Blackout/BlackoutScheduler.swift

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import Foundation
22
import Combine
3+
import CoreGraphics
34

45
/// Schedules blackouts at random intervals within the configured range.
56
/// Respects the active time window and media usage detection.
@@ -142,6 +143,13 @@ class BlackoutScheduler {
142143
return
143144
}
144145

146+
// Skip if user has been idle (no mouse/keyboard input) for 5+ minutes
147+
let userIdleSeconds = CGEventSource.secondsSinceLastEventType(.combinedSessionState, eventType: .null)
148+
if userIdleSeconds >= 300 {
149+
scheduleNext()
150+
return
151+
}
152+
145153
// Pre-trigger: check Supabase for recent breaks from other platforms
146154
Task { [weak self] in
147155
let shouldDefer = await SyncManager.shared.shouldDeferToRecentBreak()

0 commit comments

Comments
 (0)