Skip to content

sandslamsal/StayAwake

Repository files navigation

StayAwake

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.

Two ways to use it

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

Highlights

  • Native, no-input wake-keeping. Uses the Windows SetThreadExecutionState API — the same mechanism media players rely on — instead of simulating mouse/keyboard. Your cursor never twitches.
  • Small footprint. No pyautogui, no win10toast. Only pystray + Pillow for 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.

caffeinate-win (command line)

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 stop

Install & run the app from source

pip install -r requirements.txt
python stay_awake_launcher.py

The tray dependencies (pystray, Pillow) are optional — the app still runs as a normal window without them.

Build a standalone .exe

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.

Build a one-click installer

Add --package to also produce dist/StayAwake-Setup.exe (requires Inno Setup 6 with iscc on PATH):

python build.py --package

The installer gives you a Start Menu entry, optional desktop shortcut, optional "launch on Windows startup" registry entry, and a proper Add/Remove Programs uninstaller.

Automated releases (GitHub Actions)

Two workflows under .github/workflows/:

  • ci.yml — on every push/PR to main: compiles sources and runs a smoke-test on Windows.
  • release.yml — on pushing a tag starting with v (e.g. v1.0.0): builds StayAwake.exe and StayAwake-Setup.exe and attaches them to a new GitHub Release.

To cut a release:

git tag v1.0.0
git push origin v1.0.0

It also runs on manual dispatch from the Actions tab, saving the binaries as workflow artifacts (no release created).

Project layout

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

License

MIT — github.com/sandslamsal/StayAwake

About

Tiny cross-platform desktop utility (Windows · macOS · Linux) that keeps your computer awake using native OS APIs — plus a configurable daily reminder and system tray. One-click installers: .exe / .dmg / AppImage. By SyncStruct.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors