Overview
Awake is a utility that prevents Windows from entering sleep mode or turning off the display. It provides flexible control over your computer’s power state with support for indefinite, timed, and process-bound keep-awake modes.Awake uses the Win32
SetThreadExecutionState() API with ES_SYSTEM_REQUIRED and ES_DISPLAY_REQUIRED flags.Activation
Standalone Command-Line Usage
Awake can also run independently with CLI arguments:Key Features
Operating Modes
PASSIVE
Normal power behavior (utility disabled)System can sleep normally
INDEFINITE
Keep awake until manually stoppedMost common mode for extended work
TIMED
Keep awake for specific durationExample: 2 hours, 30 minutes
EXPIRABLE
Keep awake until specific date/timeExample: Until 11:59 PM today
Display Control
Independent control of display sleep behavior:Timed Operation
Set duration-based keep-awake periods:Expiration Scheduling
Keep system awake until specific date/time:Process Binding
Bind Awake to another process lifecycle:System Tray Integration
Awake provides a custom tray icon implementation:- Switch between operating modes
- Toggle display keep-awake
- Set timed durations
- Open PowerToys Settings
- Exit Awake
Configuration
Settings Location
When using PowerToys integration:Command-Line Options
Use PowerToys configuration file instead of command-line settingsShort:
-cKeep display on (prevents monitor sleep)Short:
-dDefault: falseTime limit in secondsShort:
-tExample: 3600 (1 hour)Process ID to bind toShort:
-pBehavior: Awake exits when specified process terminatesExpiration date and timeShort:
-eFormat: YYYY-MM-DD HH:MM:SSBind to parent process automaticallyShort:
-uUse case: When launched by PowerToys runnerPowerToys Settings UI
Configure Awake through PowerToys Settings:- Mode Selection: Choose operating mode from dropdown
- Display Keep-Awake: Toggle display sleep prevention
- Duration Picker: Set hours and minutes for timed mode
- Expiration Picker: Choose date and time for expirable mode
Use Cases
Long-Running Operations
Software Compilation
Software Compilation
Prevent sleep during overnight builds:Or use timed mode:
Data Processing
Data Processing
Keep system awake during data analysis or ETL jobs:
File Transfers
File Transfers
Prevent sleep during large file uploads or downloads:
- Start file transfer
- Enable Awake INDEFINITE mode
- Disable “Keep display on” to save power
- Disable Awake when complete
Presentations & Meetings
Development & Testing
Server Testing
Keep system awake while running local development servers
Automated Testing
Prevent sleep during long test suite runs
Database Operations
Keep awake during database migrations or backups
Monitoring Dashboards
Display monitoring systems without sleepEnable INDEFINITE with display on
Media & Downloads
Common scenarios:- Video Rendering: Keep system awake during video export
- Batch Downloads: Prevent sleep while downloading large files
- Media Streaming: Maintain display during video playback
- Music Playback: Keep system active for extended listening
Technical Details
Architecture
Design Highlights
- Pure Win32 Tray
- Reactive Extensions
- Dual Operation Mode
No WPF/WinForms dependencies for minimal binary sizeFile:
src/modules/awake/Awake/Core/TrayHelper.csKey Components
| Component | Purpose | File |
|---|---|---|
Program.cs | Entry point & CLI parsing | src/modules/awake/Awake/Program.cs |
Manager.cs | State orchestration & power management | src/modules/awake/Awake/Core/Manager.cs |
TrayHelper.cs | System tray UI management | src/modules/awake/Awake/Core/TrayHelper.cs |
Bridge.cs | Win32 P/Invoke declarations | src/modules/awake/Awake/Core/Native/Bridge.cs |
Dependencies
Known Limitations
Task Scheduler Idle Detection
Workarounds
Disable 'Keep display on'
Disable 'Keep display on'
Only use
ES_SYSTEM_REQUIRED without ES_DISPLAY_REQUIRED:- Prevents system sleep
- Allows Task Scheduler idle detection
- Display can still turn off
Manual maintenance tasks
Manual maintenance tasks
Run maintenance tasks manually when needed:
Schedule Awake off periods
Schedule Awake off periods
Use timed or expirable modes to allow maintenance windows:
Troubleshooting
System still goes to sleep
System still goes to sleep
Possible causes:
- Awake not running (check system tray)
- Mode set to PASSIVE
- Group Policy overriding power settings
- Laptop lid closed (triggers sleep regardless)
- Verify Awake tray icon is present
- Check current mode in tray menu
- Review Group Policy power settings
- Use external monitor with lid closed
Display still turns off
Display still turns off
Check:
- “Keep display on” is enabled in Awake settings
- Display timeout in Windows power settings
- Screen saver is disabled
Tray icon not appearing
Tray icon not appearing
Troubleshooting:
- Check if PowerToys is running
- Look in system tray overflow area
- Restart PowerToys
- Check Windows notification area settings
src/modules/awake/Awake/Core/TrayHelper.csTimed mode not expiring
Timed mode not expiring
Verify:
- Time limit is set correctly (in seconds)
- System clock is accurate
- No configuration file changes overriding timer
%LOCALAPPDATA%\Microsoft\PowerToys\Awake\LogsSee Also
- PowerToys Settings - Configure Awake options
- Command Not Found - Another CLI utility
- Registry Preview - System utility tool
Resources
- Official Website: awake.den.dev
- Microsoft Learn: PowerToys Awake Documentation
- GitHub Issues: Report bugs or request features
- Source Code:
src/modules/awake/README.md