AutoPower is a cross-platform scheduled power-operation utility. Set a specific time or countdown, and let it automatically shut down, reboot, hibernate, sleep, or turn off your display — all from a clean Qt‑based GUI. It runs quietly in the system tray and works natively on macOS, Windows, and Linux.
| Operation | Description |
|---|---|
| Shutdown | Turn off the computer completely |
| Reboot | Restart the system |
| Hibernate | Save current state to disk and power off |
| Sleep | Suspend to RAM for quick resume |
| Close Monitor | Turn off the display only |
- Scheduled Time – Pick an exact date and time from the built‑in calendar widget (with lunar calendar support)
- Countdown – Set a delay in hours and minutes from the current moment
All five operations are implemented natively on each platform — no external dependencies beyond Qt:
| Platform | Mechanism |
|---|---|
| Windows | WinAPI (ExitWindowsEx, SetSuspendState, SendMessage) with AdjustTokenPrivileges for shutdown rights |
| macOS | osascript with administrator privileges (shutdown, pmset sleepnow, pmset displaysleepnow) |
| Linux | systemd‑logind D‑Bus (PowerOff / Reboot / Suspend / Hibernate) and xset dpms force off |
- Permission probing on Linux:
CanXxxmethods detect whether the current session allows each operation; unavailable options are hidden in the UI - Background scheduling via
systemd-run --on-active=on Linux andosascripton macOS
Minimise to the system tray and let AutoPower run silently in the background. The tray icon gives quick access to restore the window or exit.
Built‑in translation support via Qt Linguist; automatically follows the system locale.
| Platform | Package Format | Minimum System |
|---|---|---|
| macOS | .dmg |
macOS 13.0+ |
| Windows | NSIS installer (.exe) + .zip |
Windows 10/11 (64‑bit) |
| Linux | DEB, RPM, .tar.gz |
systemd‑based distros |
- Qt 5.15+ or Qt 6 (Widgets module; DBus module on Linux)
- CMake 3.16+
- C++17 compiler (MSVC / GCC / Clang)
- Optional for packaging: NSIS (Windows),
dpkg‑deb&rpmbuild(Linux)
# Configure
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
# Compile
cmake --build build --config Release --parallel# Single command — CPack auto‑detects the host platform
cmake --build build --config Release --target packageGenerated packages by platform:
| Platform | Packages |
|---|---|
| macOS | .dmg |
| Windows | .exe (NSIS) + .zip |
| Linux | .deb + .rpm + .tar.gz |
| Option | Default | Description |
|---|---|---|
AUTOPOWER_APP_ID |
com.santa.autopower |
Reverse-DNS application identifier |
AUTOPOWER_DEPLOY_QT |
ON |
Automatically deploy Qt runtime libraries at install/package time |
# Install to /usr/local
PREFIX=/usr/local BUILD_DIR=build deploy/linux/install.sh
# Uninstall
PREFIX=/usr/local deploy/linux/uninstall.shAutoPower/
├── CMakeLists.txt # Root CMake + CPack configuration
├── LICENSE # MIT License
├── README.md # This file
├── main.cpp # Entry point (High‑DPI, translation)
├── mainwindow.h / .cpp / .ui # Main window — UI + logic
├── powerop.h / .cpp # Power operation core (#ifdef per platform)
├── worker.h / .cpp # Timer thread (QThread, 1‑second polling)
├── trayicon.h / .cpp # System tray icon
├── src.qrc # Qt resource file
├── schedule/ # Calendar / scheduling widgets
│ ├── customdateedit.h / .cpp # Custom date‑edit control
│ ├── lunarcalendarinfo.h / .cpp# Lunar calendar data
│ ├── minicalendaritem.h / .cpp # Mini‑calendar item
│ └── minicalendarwidget.h / .cpp # Mini‑calendar widget
└── deploy/ # Platform‑specific deployment assets
├── mac/Info.plist.in # macOS Bundle plist
├── win/app.rc.in # Windows resource template
└── linux/ # Desktop entry, AppStream metadata, icon, install/uninstall scripts
Pre‑built binaries are available on the Releases page.
AutoPower is licensed under the MIT License — see the LICENSE file for details.
Pull Requests are welcome.
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing‑feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing‑feature) - Open a Pull Request
AutoPower — set it, forget it, and let your computer turn itself off.

