Automatic power plan switcher for Windows 10 and Windows 11. A desktop application for Windows (.exe provided, but can be built) that dynamically changes the power plan based on CPU usage. This application can actually control your operating system's power settings, providing real automated power management. Please read especially the "Configuration" secction.
The clean, modern interface shows live status, configuration options, and event log in a single view
Real-time CPU monitoring with automatic event logging - settings are locked during monitoring to ensure consistency
- Screenshots
- Features
- Desktop Application (Recommended)
- Running with Docker (Web Version)
- Local Development
- How It Works
- Configuration
- Real CPU Usage Monitoring: Monitors actual CPU usage on your system
- Automatic Power Plan Switching: Switches Windows power plans based on configurable CPU thresholds
- Desktop Application: Native Electron-based desktop app with system integration
- Activity Log: Real-time monitoring of power plan changes and CPU usage
- Customizable Settings: Configure CPU thresholds and monitoring intervals
- Cross-platform UI: Modern, responsive interface built with React and Tailwind CSS
- Web Version Available: Also runnable as a web-based simulation for demonstration
The desktop application provides full functionality with real system control on Windows.
- Windows 10 or later (for power plan control)
- Node.js 18 or higher (for development only)
- Download the installer from the Releases page
- Run the installer and follow the installation wizard
- Run as Administrator for best results (required to change power plans)
-
Clone the Repository:
git clone https://github.com/jrcramos/dynamic_power_plan_switcher.git cd dynamic_power_plan_switcher -
Install Dependencies:
npm install
-
Build the Application:
npm run electron:build
The installer will be created in the
releasedirectory.
To test the application during development:
npm run electron:devThis starts both the Vite dev server and Electron in development mode with hot reload.
The web version is a simulation and cannot control actual system settings. For full functionality, use the desktop application.
- Docker Desktop installed and running on your system
-
Clone the Repository:
git clone https://github.com/jrcramos/dynamic_power_plan_switcher.git cd dynamic_power_plan_switcher -
Build the Docker Image:
docker build -t power-switcher-app . -
Run the Docker Container:
docker run -d -p 7376:80 --name power-switcher power-switcher-app
-
Access the Application: Open your web browser and navigate to:
http://localhost:7376
Stop the container:
docker stop power-switcherStart the container again:
docker start power-switcherRemove the container:
docker rm power-switcherFor web-based development without Electron:
- Node.js (version 18 or higher)
- npm (comes with Node.js)
-
Install Dependencies:
npm install
-
Start Development Server:
npm run dev
-
Access the Application: Open your browser to
http://localhost:5173 -
Build for Production:
npm run build
- CPU Monitoring: The application continuously monitors CPU usage using Node.js system APIs
- Threshold Detection: When CPU usage exceeds the configured threshold, it switches to High Performance mode
- Power Plan Switching: Uses Windows
powercfgcommand to change power plans - Return to Balanced: When CPU usage drops below the low threshold, it returns to Balanced mode
The application requests administrator privileges because changing Windows power plans requires elevated permissions. You can run it without admin rights, but power plan switching will fail (CPU monitoring will still work).
- Windows: Full functionality (CPU monitoring + power plan control)
- macOS/Linux: CPU monitoring only (no power plan control)
- Web Version: Simulation mode only
The application uses Windows Power Plan GUIDs to switch between plans:
- High Performance:
8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c - Balanced:
381b4222-f694-41f0-9685-ff5bb260df2e
To find your system's power plan GUIDs, run in Command Prompt:
powercfg /list- CPU Threshold: CPU usage percentage to trigger High Performance mode (default: 50%)
- Low CPU Threshold: CPU usage percentage to return to Balanced mode (default: 35%)
- Monitor Interval: How often to check CPU usage in seconds (default: 5s)
Issue: Power plan won't switch
- Solution: Run the application as Administrator (right-click → Run as Administrator)
Issue: Application won't start or shows a blank screen
- Solution: Ensure you have the latest version of Windows and all updates installed
- Check the log file for detailed error information (see "Log Files" section below)
Issue: High CPU usage from the app itself
- Solution: Increase the monitor interval to reduce checking frequency
The application creates log files to help diagnose issues. Log files are stored at:
- Windows:
%APPDATA%\Dynamic Power Plan Switcher\logs\app.log
You can access the log folder directly from the application footer when running the desktop version. The log file contains:
- Application startup information
- CPU monitoring data
- Power plan switching events
- Error messages and warnings
.
├── electron/ # Electron main process files
│ ├── main.ts # Main process (system integration)
│ └── preload.ts # Preload script (IPC bridge)
├── components/ # React UI components
├── hooks/ # React hooks (including power monitoring)
├── App.tsx # Main React component
├── index.html # HTML entry point
├── package.json # Dependencies and scripts
├── tsconfig.json # TypeScript config for React
├── tsconfig.electron.json # TypeScript config for Electron
└── vite.config.ts # Vite build configuration