A Python-based system tray application that monitors user activity and sends periodic notifications to ensure the user is awake and active. If the user fails to respond, the system will trigger a shutdown.
-
Dual Monitoring Modes
- Notification Mode: Sends periodic notifications at configured intervals
- Activity Mode: Monitors keyboard and mouse activity, triggers notification after inactivity threshold
-
System Tray Integration: Runs quietly in the background with easy access via system tray icon
-
Configurable Settings
- Target start time
- Notification duration
- Notification interval
- Inactivity threshold
- Hot-swappable monitoring modes
-
Audio Alerts: Plays sound notification when alerting the user
-
Activity Logging: Tracks all user interactions in a log file
-
Graceful Shutdown Prevention: Countdown timer with option to cancel shutdown
- Install required dependencies:
pip install -r requirements.txt-
(Optional) Add a
notification.mp3audio file to the project directory for custom alert sounds -
(Optional) Add an
icon.icofile for a custom system tray icon
Run the main script:
python main.pyThe application will start minimized to the system tray.
Right-click the tray icon to access:
- I'm Awake: Manually confirm you're active
- Settings: Configure monitoring parameters
- Exit: Stop the application
Access settings through the system tray menu. Available options:
| Setting | Description | Default |
|---|---|---|
| Target Time | Time to start monitoring (HH:MM format) | 02:00 |
| Notification Duration | Seconds before auto-shutdown | 60 |
| Notification Interval | Seconds between notifications | 600 |
| Script Version | notification or activity mode |
notification |
| Inactivity Threshold | Seconds of inactivity before alert (activity mode) | 900 |
Notification Mode
- Waits until the target time
- Sends periodic notifications at the configured interval
- Requires user response to prevent shutdown
Activity Mode
- Monitors keyboard and mouse activity continuously
- Triggers notification after the inactivity threshold is exceeded
- Automatically resets when activity is detected
Replace notification.mp3 with your preferred alert sound.
Replace icon.ico with your preferred tray icon (64x64 recommended).
All user interactions are logged to wake_log.txt with timestamps:
[2024-11-22 14:30:45] User clicked 'I'm Awake' via notification.
[2024-11-22 14:45:30] User clicked 'I'm Awake' via tray menu.