A Windows command-line tool that prevents your computer from going to sleep or turning off the display. Perfect for long-running tasks, presentations, or keeping your system active.
vigil temporarily overrides Windows power management settings to keep your computer awake. It offers three ways to prevent sleep:
vigil start— Start sleep prevention that runs until you manually stop itvigil end— Stop a running vigil sessionvigil stand— Prevent sleep while running a specific command
Build from source using Swift Package Manager:
swift build --configuration releaseThe executable will be available at .build/release/vigil.exe.
# Prevent computer from sleeping due to inactivity
vigil start --idle
# Also keep the display on
vigil start --idle --display
# Stop when done
vigil end# Prevent sleep for 2 hours (7200 seconds)
vigil start --idle --timeout 7200# Keep system awake while running a backup
vigil stand --idle -- robocopy C:\Important D:\Backup /MIR
# Keep display on during a video conversion
vigil stand --display -- ffmpeg -i input.mp4 output.mkv--idle/-i— Prevent the computer from sleeping due to inactivity--display/-d— Prevent the display from turning off--system/-s— Prevent sleep only when running on AC power (not battery)
--timeout <seconds>/-t— Automatically stop after specified seconds (only withstart)
Long download or upload:
vigil start --idle
# Run your download/upload
vigil endPresentation or demo:
vigil start --display --idle
# Give your presentation
vigil endOvernight batch job:
vigil stand --idle -- python my_long_script.pyVideo call or streaming:
vigil start --display --system # Only when plugged invigil uses Windows power management APIs to temporarily change execution state:
- Requests that Windows keep the system and/or display active
- Automatically restores normal power settings when stopped
- Uses named events for communication between
startandendcommands
vigil end doesn't work:
- Make sure you're running as the same user who ran
vigil start - Only one
vigil startsession can run at a time
Computer still goes to sleep:
- Check if other power policies (group policy, manufacturer tools) are overriding settings
- Try combining
--idleand--displayflags - Verify you're using the correct flags for your scenario
--system flag has no effect:
- This flag only prevents sleep when on AC power
- Check your power status in Windows settings