Skip to content

feat!: modernize onto keepawake-rs 0.6.0 and revamp activity simulation - #1

Merged
omerbustun merged 5 commits into
mainfrom
refactor/modernize-upstream-0.6.0
Jun 23, 2026
Merged

omerbustun merged 5 commits into
mainfrom
refactor/modernize-upstream-0.6.0

Conversation

@omerbustun

Copy link
Copy Markdown
Owner

Rebases the fork onto upstream keepawake-rs 0.6.0 and rewrites the fork's activity feature as a proper RAII subsystem. Bumps the crate to 0.2.0.

Upstream modernization (0.4.5-era → 0.6.0)

  • macOS: migrated off the unmaintained apple-sys/core-foundation to objc2-core-foundation/objc2-io-kit.
  • Linux: zbus 3 → 5 (#[dbus_proxy] → #[proxy]).
  • Windows: windows 0.52 → 0.62; WindowsError::from_win32() → from_thread() (the former was removed in 0.62).
  • Library error type: custom thiserror-based Error/Result instead of anyhow; anyhow is now bin-only.
  • Deps: sysinfo 0.30 → 0.37, shadow-rs 0.26 → 1.4 (ShadowBuilder), derive_builder 0.12 → 0.20, enigo 0.1 → 0.6, added thiserror 2.
  • CLI fixes: -w <PID> now blocks on the process via the sysinfo 0.37 API instead of polling; exits 130 on Ctrl-C.

Activity feature revamp

  • Replaced the fire-and-forget simulate_activity() (infinite loop, unreachable error path, hardcoded 60s) with an RAII ActivitySimulator that stops and joins its worker thread on drop and surfaces backend-init errors synchronously.
  • New --method <mouse|key>: mouse (default) keeps the existing 1px nudge; key taps F15 with no cursor movement for a distraction-free option.
  • New --interval <SECONDS> (default 60).
  • Gated behind a new activity Cargo feature (pulls enigo); enabled automatically by bin.

Verification

  • macOS: full --all-features build, clippy, fmt, tests/doctests, release build, and binary smoke tests — all clean.
  • Linux & Windows: cargo check clean for the ported backends + enigo 0.6.
  • CI: removed the continue-on-error that was hiding cargo fmt failures; bumped actions/checkout v3 → v5.

Breaking changes

  • Library APIs return keep_active::Error instead of anyhow::Error.
  • simulate_activity() is replaced by ActivitySimulator.

Drop continue-on-error from the formatting step so misformatted code fails CI, and update actions/checkout v3
  -> v5.
Bump zbus 3->5, windows 0.52->0.62, sysinfo 0.30->0.37, shadow-rs 0.26->1.4, derive_builder 0.12->0.20, enigo
  0.1->0.6; replace apple-sys/core-foundation with objc2-core-foundation/objc2-io-kit on macOS; add thiserror. Make
  anyhow bin-only, add an 'activity' feature gating enigo, switch build.rs to shadow-rs ShadowBuilder, and bump the
  crate to 0.2.0.
Replace the fire-and-forget simulate_activity() with an ActivitySimulator that stops and joins its worker
  thread on drop and surfaces backend init errors. Add --method <mouse|key> (mouse jiggle, default, or a no-op F15
  keypress with no cursor movement) and --interval <SECONDS>. Also adopt upstream's CLI fixes: block on the watched
  PID via sysinfo 0.37 and exit 130 on Ctrl-C.
Document --method and --interval, refresh the usage block, add a status-tracker section, and reconcile the
  changelog with the shipped activity behavior.
…ror type

macOS uses objc2-io-kit assertions, Linux uses the zbus 5 #[proxy] macro, and Windows uses
  WindowsError::from_thread() (from_win32 was removed in windows 0.62). The library now exposes a thiserror-based
  Error/Result instead of anyhow and declares the feature-gated activity module.

BREAKING CHANGE: library APIs return keep_active::Error instead of anyhow::Error.
@omerbustun
omerbustun merged commit 204b5f3 into main Jun 23, 2026
4 checks passed
@omerbustun
omerbustun deleted the refactor/modernize-upstream-0.6.0 branch June 23, 2026 10:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant