Skip to content

About

Tiny Windows tray app that prevents sleep - indefinitely, for a set time, or only while chosen apps run. Pure PowerShell, no install.

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

Repository files navigation

KeepAwake

A tiny Windows tray app that keeps your PC awake. Uses the same SetThreadExecutionState API as PowerToys Awake. Pure PowerShell — no install, no dependencies, no admin rights needed.

Run it

Double-click KeepAwake.cmd. A confirmation window flashes for a few seconds, then a colored dot appears in the system tray (bottom-right). If you can't see it, click "^" next to the clock and drag it out to keep it visible.

Note: double-clicking KeepAwake.ps1 only opens it in an editor — always launch via KeepAwake.cmd (or KeepAwake.vbs for a fully silent start).

Tray icon colors:

  • Green = preventing sleep
  • Yellow = standby (watching for an app that isn't running yet)
  • Gray = off

Menu (right-click)

Item What it does
Always on Prevent sleep indefinitely. Click again or double-click the icon to turn off
For a set time Presets: 15 min / 30 min / 1-3 h. "Enter minutes..." or "Enter end time..." (e.g. 18:30 — rolls to tomorrow if already past)
While apps run Pick from currently running apps; sleep is prevented only while they run (e.g. chrome). Multi-select supported. "Enter process name..." covers processes without windows
Off Disable
Also keep the display on Prevents the screen from turning off too (default: sleep only, display may sleep)
Run at startup Launches with Windows. Settings (watched apps, mode) persist in %APPDATA%\KeepAwake\config.json and are restored on reboot

Command line

powershell -NoProfile -STA -ExecutionPolicy Bypass -WindowStyle Hidden -File KeepAwake.ps1 -Mode Indefinite
# 60 minutes only
... -Minutes 60
# until 18:30
... -Until "18:30"
# only while chrome and msedge are running
... -Watch chrome, msedge

Verify it's working

powercfg /requests

While active, powershell.exe appears under the SYSTEM section.

Quit

Right-click the tray icon → Exit. If the process is killed, Windows releases the sleep block automatically (it's tied to the process).

Duplicate instances

A mutex prevents it — a second launch exits immediately.

Files

  • KeepAwake.ps1 — the app itself
  • KeepAwake.vbs — silent launcher (used by the startup shortcut)
  • KeepAwake.cmd — launcher with a visible confirmation
  • keep-awake.ico — optional icon for shortcuts

License

MIT

About

Tiny Windows tray app that prevents sleep - indefinitely, for a set time, or only while chosen apps run. Pure PowerShell, no install.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages