Skip to content

Repository files navigation

Auto Shutdown Manager

Python Windows License: MIT GitHub release GitHub downloads

No installation, no Python, no setup — download it and double-click. Windows 10/11.

📖 Description

Auto Shutdown Manager is a user-friendly Windows desktop application that automatically shuts down, restarts, hibernates, or puts your PC to sleep after a period of inactivity (no mouse/keyboard input).

Perfect for:

  • Preventing forgetting to shut down during work/breaks
  • Power management in offices/home setups
  • Timed auto-power-off for security/energy saving

💡 Why I Built This App (vs. Windows Timers)

I often fall asleep during movie nights – PC runs all night! Windows has no simple "idle timer" for this, and built-in idle ignores media:

"Windows‑Idle‑Events are counterproductive here – they prevent shutdown during playback. My script simply watches real input (mouse/keyboard)."

Key Advantage: Still awake after time? Just wiggle your wireless mouse/remote (no getting up!) → Timer resets instantly, keep watching! No manual stop needed.

Features a simple UI, live progress tracking, system tray support, and multi-language (DE/EN).

✨ Features

  • Idle Time Monitoring: Real-time tracking of inactivity using Windows API
  • Configurable Timer: Slider (1-480 minutes) + presets (30min, 1h, 2h, 4h)
  • Power Actions: Shutdown, Restart, Hibernate, Sleep
  • Warning Dialog: 60s countdown ring with sound alerts, auto-cancel if active
  • System Tray: Minimize to tray, notifications, quick open/exit
  • Keep-Awake: Prevents sleep/standby during monitoring
  • Modern UI: CustomTkinter with circular progress ring, dark/light mode toggle
  • Persistent Settings: Saves config to settings.json
  • Multi-Language: German/English (extensible via JSON)
  • EXE-Ready: PyInstaller compatible with bundled assets/locales
  • Fallbacks: Auto-generates icon if missing, graceful lang errors

🤖 Automation

Three independent options, all off by default — nothing changes unless you turn them on:

Option What it does
Start monitoring automatically Begins monitoring the moment the app opens. No need to press START.
Start with Windows Launches the app when you log in.
Start minimized Opens without a visible window.

Turn on all three and the app becomes a silent background service: it starts with Windows, watches for idle time, and you never see it until it warns you.

Start with Windows writes to HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run. No administrator rights are needed and other user accounts are unaffected. Unticking the box removes the entry again. You can always check for yourself under Task Manager → Startup apps.

📸 Screenshots

Main window Warning dialog

🚀 Quick Start

Prerequisites

  • Python 3.8+
  • Windows 10/11

Download EXE (Recommended - No Python needed)

Download the latest AutoShutdownManager.exe from GitHub Releases.

Development Installation

  1. Clone/Download the repo

  2. Install dependencies:

    pip install -r requirements.txt
  3. Run:

    python main.py

Building Standalone EXE

Local Build

pip install -r requirements.txt
pyinstaller build.spec

EXE in dist/AutoShutdownManager.exe.

GitHub Builds

📋 Usage

  1. Launch main.py
  2. Select Action (Shutdown/Restart/etc.)
  3. Set time limit via slider/presets/entry
  4. Tick any Automation options you want (all optional)
  5. Click START → The ring fills as idle time adds up
  6. When the limit is reached: warning dialog appears (60s countdown)
  7. Move mouse/type to cancel → Or the action runs automatically

Pro Tip: For hands-off use, tick Start with Windows, Start monitoring automatically, Start minimized and Minimize to tray. The app then lives in the tray and you only ever see the warning dialog. Right-click the tray icon to open or quit it.

⚙️ Configuration

Settings auto-save to settings.json, created next to the executable on first change. Deleting it resets everything to the defaults below:

{
    "language": "en",
    "target_minutes": 60,
    "action": "shutdown",
    "appearance_mode": "Dark",
    "minimize_to_tray": false,
    "auto_start_monitoring": false,
    "run_on_windows_startup": false,
    "start_minimized": false
}

run_on_windows_startup mirrors the registry rather than driving it. The registry is the source of truth, so removing the entry outside the app (via Task Manager or msconfig) is picked up on the next start.

🌐 Localization

  • Add new langs: Copy + translate keys
  • Keys used: HEADER_TITLE, STATUS_ACTIVE, etc. (see code)

🛠️ Troubleshooting

  • No tray icon? Install pystray + Pillow
  • "Start with Windows" won't stick? Some cleanup tools and group policies strip entries from the Run key. Check Task Manager → Startup apps; if the entry is missing right after ticking the box, something removed it. Failures are logged to app.log next to the executable.
  • App starts with Windows but no window appears? That is Start minimized doing its job — look for the tray icon.
  • Countdown finishes but the PC stays on? The chosen action is failing silently. Hibernate in particular is often unavailable — run powercfg /a in a terminal to see which sleep states your machine actually supports, and pick a different action if yours is not listed. The app will not re-open the dialog until you have been active again, so it will not spam you.

🤝 Contributing

  1. Fork & PR
  2. Add features/tests
  3. Update locales/README

📄 License

MIT - See LICENSE


Built with ❤️ for myself and everybody else

About

Windows idle timer that automatically shuts down, restarts, hibernates, or sleeps your PC — with system tray support and DE/EN localization.

Topics

Resources

Contributing

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages