PowerModeSlider
June 23, 2026 Β· View on GitHub
A lightweight Windows 11 system tray application for quickly switching power modes.
Overview
PowerModeSlider lives in your system tray and provides a simple slider flyout to switch between Windows 11 power modes instantlyβno need to dig through Settings.
Features
- π System Tray App β Runs quietly in the background
- β‘ One-Click Access β Click the tray icon to show/hide the slider
- ποΈ Simple Slider UI β Drag to switch between three power modes
- β Keep Awake β Toggle the coffee button to stop the machine sleeping (ON forever / OFF, no timers)
- π Dynamic Icon β Tray icon updates to reflect current power mode, with an amber badge while keep-awake is on
- πͺ Native Look β Uses Windows 11 Acrylic backdrop
Power Modes
| Mode | Description |
|---|---|
| π Best Power Efficiency | Saves power by reducing performance and brightness |
| βοΈ Balanced | Full performance when needed, saves power when idle |
| β‘ Best Performance | Maximum performance and screen brightness |
How It Works
The app uses the official Windows Power Management APIs (PowerSetUserConfiguredACPowerMode / PowerSetUserConfiguredDCPowerMode) introduced in Windows 11 to change power modes for both AC (plugged in) and DC (battery) states.
Requirements
- Windows 11 (Build 22000 or later)
- .NET 10 Runtime
Usage
- Launch the app β it minimizes to the system tray
- Left-click the tray icon to open the power slider
- Drag the slider to your desired power mode
- Right-click the tray icon to exit
Development
This project supports the Windows App Development CLI (winapp), which lets you build and run the packaged WinUI 3 app directly from the terminal β no Visual Studio required.
Prerequisites
Install the .NET 10 SDK and the winapp CLI:
winget install Microsoft.DotNet.SDK.10 --source winget
winget install Microsoft.winappcli --source winget
Run (dotnet run)
The project includes the Microsoft.Windows.SDK.BuildTools.WinApp NuGet package, which hooks dotnet run into winapp run automatically. Run from the PowerModeSlider/ sub-folder, passing a runtime identifier (the packaged app cannot build as the default AnyCPU):
cd PowerModeSlider
dotnet run -r win-x64
This registers a loose-layout package with Windows and launches the app with full package identity.
Run (manual winapp)
Build first, then invoke winapp run pointing at the build output:
dotnet build -c Debug -r win-x64
winapp run .\bin\Debug\net10.0-windows10.0.19041.0\win-x64
Package for distribution (MSIX)
Build in Release, then pack and sign. Because the app's Package.appxmanifest
declares Publisher="CN=gungaretti", the signing certificate's subject must
match that publisher and must be trusted on the machine, or Windows refuses
to install the package (0x800B010A). winapp pack handles this for you β it
reads the manifest, generates a matching development certificate, trusts it, and
signs the package in one step:
dotnet build -c Release -r win-x64
winapp pack .\bin\Release\net10.0-windows10.0.19041.0\win-x64 --generate-cert --install-cert
Then install the generated .msix (e.g. Add-AppxPackage .\PowerModeSlider_*.msix).
Prefer to manage the certificate explicitly? Generate one whose publisher matches the manifest, trust it, then sign with it:
winapp cert generate --manifest .\Package.appxmanifest --install --output .\devcert.pfx --if-exists skip
dotnet build -c Release -r win-x64
winapp pack .\bin\Release\net10.0-windows10.0.19041.0\win-x64 --cert .\devcert.pfx
Use winapp cert info .\devcert.pfx to confirm the certificate subject matches the
manifest publisher before signing.
Tip: Increment the
VersioninPackage.appxmanifestbefore re-packing to allow Windows to update the installed package.
Project Structure
PowerModeSlider/
βββ PowerModeSlider/ # WinUI 3 tray application
βββ PowerModeLib/ # .NET library for power mode APIs
βββ KeepAwakeLib/ # .NET library for keep-awake (SetThreadExecutionState)