Skip to content

Latest commit

 

History

29 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

KeepAwake 🖥️

Python License Status

A lightweight Windows tray app that prevents your PC from going into standby during working hours if connected to ac.
It runs silently in the system tray with a green/orange/red status icon and simple menu controls.


✨ Features

  • 🟢 Green tray icon when supressing standby in working hours, 🟠 orange icon when active but not in working hours, 🔴 red icon when stopped , 🔵 Blue icon — if awake forced (even outside working hours)
  • ⏰ Keeps your PC awake Monday–Friday, 08:00–18:00 (configurable)
  • 📜 Logging with loguru (keep_awake.log, rotated daily)
  • 🖱️ Tray menu options: Start / Stop / Force / Sleep timer / Exit
  • 💤 Sleep timer: puts the PC to sleep after 15/30/60/90/120 min (presets configurable) or any number of minutes via Custom.... The countdown shows in the tray tooltip and at the top of the tray menu. While it runs, the tray icon turns purple with a 💤 and the minutes left (seconds in yellow during the last minute). Works on Modern Standby (S0) PCs too
  • 🚀 Build into a standalone .exe with PyInstaller

📦 Requirements

⚙️ Configuration (config.json)

The behavior of KeepAwake can be customized using a simple config.json file located in the same folder as the script or executable.

  • start_hour: hour of the working week where the script should begin to avoid standby
  • end_hour: hour of the working week where the script should end the avoid of standby
  • sleep_after_min: configuration for the powerplan sleep after x minutes
  • check_interval_sec: seconds to wait to check again if the powerplan must be changed based on time
  • disable_if_workstation_locked: disables the function if workstation is locked, default is false
  • sleep_timer_presets_min: the countdowns (in minutes) offered in the "Sleep timer" menu, default is [15, 30, 60, 90, 120]

Example config.json

{
  "start_hour": 8,
  "end_hour": 18,
  "sleep_after_min": 30,
  "check_interval_sec": 300,
  "disable_if_workstation_locked": false,
  "sleep_timer_presets_min": [15, 30, 60, 90, 120]
}

Install with uv.

  uv add loguru pystray pillow
  
  ▶️ Run from source
  uv run python keep_awake_tray.py
  
  🛠️ Build as EXE
  
  Bundle into a Windows executable:
  
  uv add pyinstaller --dev
  uv run pyinstaller --onefile --noconsole keep_awake_tray.py

The .exe will be generated in dist/keep_awake_tray.exe

Preview

image

About

Little Tray Programm which avoid Standby in the working hours if connected to ac

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages