12 releases
new 0.3.1 | Feb 19, 2025 |
---|---|
0.3.0 | Feb 19, 2025 |
0.2.3 | Feb 17, 2025 |
0.1.5 | Feb 6, 2025 |
0.1.3 | Jan 30, 2025 |
#285 in Hardware support
945 downloads per month
Used in os-monitor-service
47KB
1K
SLoC
Monitor
The monitor is a Rust application that runs on your computer and is responsible for monitoring your activities. It is specifically responsible for monitoring (but not recording) your window, mouse and keyboard activity. Architecture supports multiple platforms.
Implemented platforms:
- macOS
- Windows
- Linux
Example Usage
Here's an example of how to use the monitor as a library by registering event callbacks:
let monitor = Monitor::new();
// Register event callbacks
monitor.register_keyboard_callback(Box::new(on_keyboard_events));
monitor.register_mouse_callback(Box::new(on_mouse_events));
monitor.register_window_callback(Box::new(on_window_event));
initialize_monitor(Arc::new(monitor)).expect("Failed to initialize monitor");
loop {
detect_changes().expect("Failed to detect changes");
std::thread::sleep(std::time::Duration::from_secs(1));
}
On first run on macOS, you'll need to grant accessibility permissions to the application. This is required to monitor window focus and input events.
Building and Running
cargo build
cargo run
Prerequisites
- Rust toolchain (install via rustup)
- For macOS:
- Xcode Command Line Tools
Architecture
See architecture.md for more information.
Security and Privacy
- The monitor only tracks event metadata, not content
- Window titles, application names, and browser urls are captured for context
- All data processing happens locally
Development Guidelines
Adding OS Support
To add support for a new OS platform:
- Create new platform-specific module in
src/platform/
- Implement native bindings in
bindings/
- Implement required traits and functions
- Update conditional compilation flags
Other notes
Brought over from the original repo: https://github.com/CodeClimbersIO/app-codeclimbers
Dependencies
~2–9.5MB
~99K SLoC