A tiny Windows desktop utility that keeps your computer from sleeping — plus an
optional daily reminder (e.g. "fill out your timesheet"). Includes a lightweight
command-line tool (caffeinate-win) for users who just want a one-liner.
| What it is | Best for | |
|---|---|---|
| StayAwake app | A small GUI + system-tray app | Click-to-toggle, daily reminders |
| caffeinate-win | A command-line tool (caffeinate -d / -i) |
Quick, scriptable, no install |
- Native, no-input wake-keeping. Uses the Windows
SetThreadExecutionStateAPI — the same mechanism media players rely on — instead of simulating mouse/keyboard. Your cursor never twitches. - Small footprint. No
pyautogui, nowin10toast. Onlypystray+Pillowfor the tray icon; everything else is stdlib. - System-tray support. Minimize the window and StayAwake keeps running silently from the tray. Right-click for quick pause/resume.
- Configurable daily reminder. Pick any time and message; notifications use a native Windows toast via PowerShell (no extra dependencies).
- Persistent settings stored per-user, with optional auto-start and start-minimized-to-tray.
The simplest way to keep Windows awake from a terminal — no Python, no install. See caffeinate-win/README.md.
caffeinate -d :: keep display + system awake until Ctrl+C
caffeinate -i :: keep system awake (screen may sleep)
caffeinate -t 3600 :: keep awake for one hour, then stoppip install -r requirements.txt
python stay_awake_launcher.pyThe tray dependencies (pystray, Pillow) are optional — the app still runs
as a normal window without them.
PyInstaller produces a single-file dist/StayAwake.exe:
pip install pyinstaller
python build.py # rebuilds only if sources changed
python build.py --force # always rebuild
python build.py --console # keep the console window (debugging)icon.ico at the project root is picked up automatically.
Add --package to also produce dist/StayAwake-Setup.exe (requires
Inno Setup 6 with iscc on PATH):
python build.py --packageThe installer gives you a Start Menu entry, optional desktop shortcut, optional "launch on Windows startup" registry entry, and a proper Add/Remove Programs uninstaller.
Two workflows under .github/workflows/:
ci.yml— on every push/PR tomain: compiles sources and runs a smoke-test on Windows.release.yml— on pushing a tag starting withv(e.g.v1.0.0): buildsStayAwake.exeandStayAwake-Setup.exeand attaches them to a new GitHub Release.
To cut a release:
git tag v1.0.0
git push origin v1.0.0It also runs on manual dispatch from the Actions tab, saving the binaries as workflow artifacts (no release created).
stay_awake/
__init__.py # version + metadata
app.py # Tkinter GUI
core.py # OS-native wake-keeping
notifier.py # Notifications + daily reminder scheduler
config.py # Per-user JSON config
tray.py # Optional pystray integration
icon.py # Procedural tray icon
build.py # PyInstaller wrapper (Windows)
make_icon.py # Regenerates the coffee-cup app icon
caffeinate-win/ # Standalone command-line keep-awake tool
stay_awake_launcher.py