Activity Driver
Simulates realistic user activity (browser, file, HID mouse/keyboard events) on macOS. Prevents macOS idle sleep and auto-logout via caffeinate. Includes a live dashboard at http://localhost:3006.
Overview
Activity Driver is a Python library that simulates realistic work activity to maintain your online presence. It includes:
- Activity Driver — Core event simulation engine (browser, file, HID events)
- HID Events — Real OS-level HID event generation via macOS Quartz
- Daily Report — Live HTML dashboard showing activity metrics
- Launcher — Orchestrates Activity Driver + Daily Report together
Installation
Prerequisites
- macOS 10.13+
- Python 3.9+
- Google Chrome (for browser activity simulation)
- Accessibility Permission (for keyboard/mouse events)
System-Wide Install (Recommended)
pip install activity-driver
Development Install (editable)
pip install -e /path/to/activity-driver
Verify Installation
python -c "import activity_driver; print(activity_driver.__version__)"
Quick Start
First Time Setup
On first run, configure your settings:
activity-config show # Display current settings
activity-config domains # Add productive URLs
activity-config profile # Set your Chrome profile
Settings are saved to ~/.config/activity-driver/config.json
Run All Components (Driver + Dashboard)
activity-launcher
This will:
- Start the Activity Driver in the background
- Start the Daily Report dashboard on http://localhost:3006
- Auto-open your browser to the dashboard
Stop with Ctrl-C
Run Individual Components
Activity Driver only:
activity-driver
Daily Report only (on custom port):
activity-report 8080
From Python:
from activity_driver.activity_driver import main
main()
Configuration
Settings are saved to ~/.config/activity-driver/config.json and automatically used by the driver.
Manage Configuration Anytime
activity-config show # Display current config
activity-config domains # Edit productive URLs
activity-config profile # Change Chrome profile
activity-config reset # Reset to defaults
CLI Commands
activity-launcher
Start all components (driver + dashboard) together
activity-launcher
activity-driver
Run only the activity simulation engine
activity-driver
activity-report
Run only the dashboard (HTTP server)
activity-report 3006 # Default port
activity-report 8080 # Custom port
activity-config
Manage settings
activity-config show # Display all settings
activity-config domains # Edit productive URLs
activity-config profile # Change Chrome profile
activity-config reset # Reset to factory defaults
Permissions
Accessibility (Optional)
For keyboard clicks to work, grant Accessibility permission:
- System Settings → Security & Privacy → Privacy → Accessibility
- Add your Python interpreter or terminal app
- Restart the driver
Without Accessibility: Mouse movement and scroll events still work, which is sufficient for most activity tracking systems.
Chrome Profile Access
The driver must be able to open Chrome. Ensure your profile is accessible in /Users/$USER/Library/Application\ Support/Google/Chrome/
Dashboard Features
The live dashboard at http://localhost:3006 shows:
- Total events — Total activity count for today/yesterday
- Event breakdown — Browser (unique/repeated), file writes, app switches
- Top URLs — Most frequently visited domains
- Hourly activity — Bar chart of events per hour
- Active window — First and last activity timestamps
- Auto-purge — Logs older than 2 days are automatically removed
Dashboard auto-refreshes every 30 seconds.
Technical Details
HID Event Generation
Real OS-level events via macOS Quartz API:
| Event | Permission | Recognized by System |
|---|---|---|
| Mouse move | ✅ NO Accessibility | ✅ Yes (resets HIDIdleTime) |
| Scroll wheel | ✅ NO Accessibility | ✅ Yes |
| Click | ⚠️ Accessibility required | ✅ Yes |
| Keyboard | ⚠️ Accessibility required | ✅ Yes |
Without Accessibility, mouse + scroll events are sufficient to reset system idle timers.
Idle Prevention
- Heartbeat —
caffeinate -uruns every 25 seconds to assert user activity - Anti-idle — Guaranteed lightweight event every 90 seconds during reads
- No gaps — Events spaced to ensure continuous activity detection
Log Format
Events are stored in .session_data as JSON:
{
"ts": "2026-06-18T14:23:45",
"date": "2026-06-18",
"hour": 14,
"type": "BROWSER",
"label": "repeated",
"detail": "https://example.com/shared"
}
Retention: 2 days (auto-purged)
Troubleshooting
"WARNING: Quartz not available"
Install the required dependency:
pip install pyobjc-framework-Quartz
Dashboard not loading
Check the port isn't in use:
lsof -i :3006
Use a custom port:
activity-report 8080
Chrome not opening URLs
- Verify Chrome is installed at
/Applications/Google Chrome.app - Check your Chrome profile name at
chrome://version - Update
CHROME_PROFILEin the driver config
Accessibility permission missing
Grant Accessibility permission in System Settings → Security & Privacy → Privacy
Development
Install for Development
pip install -e ".[dev]"
Run Tests
pytest -v
pytest --cov=src/activity_driver
Code Style
Format with Black:
black src/
Lint with Flake8:
flake8 src/
Uninstall
pip uninstall activity-driver
License
Proprietary License. All rights reserved.
Support
For issues, feature requests, or questions, see the GitHub repository documentation.
Version History
1.0.4 (2026-06-19)
- Fixed config variable assignment bug in activity_driver.py
- Improved README with CLI commands and prerequisites
- Better setup instructions for first-time users
- Removed all brand-specific references
- Complete documentation with permissions guide
- Clean, production-ready package for any Mac
1.0.0 (2026-06-18)
- Initial release
- Activity Driver core engine
- HID event generation (Quartz)
- Daily Report dashboard
- Launcher orchestrator
- macOS LaunchAgent support (via setup.sh)
Metadata
Release files for activity-driver 1.0.8
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| activity_driver-1.0.8.tar.gz | 26.8 kB | Without provenance | Details for activity_driver-1.0.8.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| activity_driver-1.0.8-py3-none-any.whl | Python 3 | none | any | Details for activity_driver-1.0.8-py3-none-any.whl |
Total release size: 46.9 kB
Release files / activity_driver-1.0.8.tar.gz
| Download URL | activity_driver-1.0.8.tar.gz |
|---|---|
| Size | 26.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e984acba198c1534bab51b32c604ddcdfec89da1c32ef9603063a1b988e1ab2b
|
|
BLAKE2b-256 checksum How to use checksums |
e82d53837d2ec9ca5908990f9acee4538b83e27b0d7744b7d3f0df418c9828a6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.9
|
Release files / activity_driver-1.0.8-py3-none-any.whl
| Download URL | activity_driver-1.0.8-py3-none-any.whl |
|---|---|
| Size | 20.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9943f89ff17057a3033720758fcf7dc96590c10b89a8e2ce9f75917f7b70dc64
|
|
BLAKE2b-256 checksum How to use checksums |
c53e006825ab85fdd1ca67147c7a5914f7fef7068f75ffeb395fa197988dadce
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.9
|
Security for activity-driver 1.0.8
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.