Skip to content

ogden-marrow/PowerID_For_Windows

Repository files navigation

PowerID ⚡ (Windows)

PowerID Icon .NET License

Advanced Battery Monitoring for Windows

A native WinUI 3 app that provides detailed insights into your PC's battery health, performance, and power consumption. This is the Windows counterpart to PowerID for Mac, rebuilt from scratch on the Windows App SDK (no Electron, no web views).

FeaturesInstallationBuildingArchitecture

PowerID Overview screenshot


✨ Features

Real-Time Monitoring

  • Battery information refreshes every 2 seconds (configurable in Settings)
  • Reads directly from the ACPI battery WMI classes (root\WMI)
  • Lightweight native C# implementation, no background services

Comprehensive Battery Information

📊 Overview Tab

  • Battery level with a dynamic color gradient
  • Charging status and charging power (W)
  • Estimated time to full charge
  • Battery health at a glance
  • Cycle count

📋 Details Tab

  • Capacity: Current / Maximum / Design capacity (mAh), battery level (%)
  • Electrical: Voltage (V), Amperage (mA), Power draw (W)
  • Health & Lifecycle: Health (%), cycle count, temperature (°C, where the firmware reports it)
  • Power Source: Charging status, power source type, time to full charge

ℹ️ Info Tab

Plain-language explanations of every metric plus battery care tips.

Native Windows Experience

  • Pure WinUI 3 (Fluent Design), no third-party UI frameworks
  • System tray icon showing live battery % (Services/TrayIconService.cs), with a right-click menu for status, health, show/quit
  • Dark/light theme aware
  • Optional "close to tray" behavior, same as the menu bar toggle on macOS

🚀 Installation

Option 1: Download a Release

  1. Go to the Releases page
  2. Download PowerID-win-x64.zip
  3. Unzip it anywhere and run PowerID.exe

⚠️ First Launch

Since the app is unsigned, Windows SmartScreen may show a warning the first time you run it:

  1. Click "More info"
  2. Click "Run anyway"

Option 2: Build from Source

See Building from Source below.


🛠 Building from Source

Prerequisites

  • Windows 10 (build 17763+) or Windows 11
  • .NET 8 SDK
  • Visual Studio 2022 (17.8+) with the Windows App SDK and .NET Desktop Development workloads (or the standalone Windows App SDK tooling)
  • Python 3 + Pillow (only needed to regenerate app icons)

Build Steps

  1. Clone the repository

    git clone https://github.com/ogden-marrow/PowerID_For_Windows.git
    cd PowerID_For_Windows
  2. Generate app icons (optional, already committed under PowerID/Assets)

    pip install Pillow
    python generate_icon.py
  3. Open in Visual Studio

    start PowerID.sln
  4. Build and Run

    • Set the platform to x64 (or arm64)
    • Press F5 to build and run, or Ctrl+Shift+B to build only

Command Line Build

Use the full msbuild.exe (from the Visual Studio/Build Tools installation), not dotnet build - the .NET SDK's own MSBuild host has been unreliable at launching XamlCompiler.exe, the .NET Framework 4.7.2 tool that compiles .xaml files:

dotnet restore PowerID.sln
msbuild PowerID.sln /p:Configuration=Release /p:Platform=x64

Unpackaged, self-contained publish (no MSIX/signing required)

msbuild PowerID/PowerID.csproj /t:Publish /p:Configuration=Release /p:Platform=x64 `
  /p:WindowsPackageType=None /p:WindowsAppSDKSelfContained=true /p:SelfContained=true `
  /p:RuntimeIdentifier=win-x64 /p:PublishDir=publish\PowerID

The runnable app will be at publish/PowerID/PowerID.exe.

Running the Tests

PowerID.Core (the battery math and formatting logic) has no Windows/WinUI dependency, so its test suite in PowerID.Tests runs anywhere with just the .NET 8 SDK - no Windows required:

dotnet test PowerID.Tests/PowerID.Tests.csproj

CI runs this on every push/PR (on ubuntu-latest, before the slower Windows build even starts) - see the test job in .github/workflows/build-release.yml.


🏗 Project Structure

See ARCHITECTURE.md for the full breakdown, the PowerID.Core/PowerID/PowerID.Tests split, MVVM structure, and a macOS → Windows API mapping table (IOKit ↔ WMI, NSStatusItemShell_NotifyIcon, etc.).


🔧 Technical Details

Battery Metrics Explained

Metric Description Source
Battery Level Current charge as % of max capacity BatteryStatus (WMI)
Current Capacity Actual charge in mAh (derived from mWh / design voltage) BatteryStatus
Max Capacity Current full-charge capacity in mAh BatteryFullChargedCapacity
Design Capacity Original factory capacity in mAh BatteryStaticData
Battery Health (Max / Design) × 100% Calculated
Cycle Count Total charge-discharge cycles BatteryCycleCount
Voltage Battery voltage in volts BatteryStatus
Amperage Current flow in milliamps (derived from rate / voltage) Calculated
Wattage Charge/discharge rate in watts BatteryStatus
Temperature Battery temperature in Celsius, if reported by firmware BatteryTemperature

System Requirements

  • Operating System: Windows 10 (build 17763+) or Windows 11
  • Architecture: x64 or ARM64
  • Hardware: A PC/laptop with a battery

🤝 Contributing

Contributions are welcome!

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Ideas for Contributions

  • Low battery / fully-charged notifications (toast notifications)
  • Real "Launch at login" registration (StartupTask API)
  • Historical battery data tracking
  • MSIX signing + Microsoft Store packaging
  • Localization for other languages

📊 Automated Builds

PowerID uses GitHub Actions (.github/workflows/build-release.yml) to build on every push/PR, and to publish a zipped release when a v* tag is pushed:

git tag -a v1.0.0 -m "Release version 1.0.0"
git push origin v1.0.0

🐛 Troubleshooting

App Won't Open

Problem: Windows SmartScreen blocks the app ("Windows protected your PC")

Solution: Click "More info" then "Run anyway".

Battery Data Not Showing

Problem: All values show as 0 or "Unknown"

Solution:

  • Ensure you're running on a device with a battery
  • Some OEM firmware doesn't expose BatteryTemperature over WMI - this is expected and shows as 0°C
  • Try restarting the app

Build Errors

Problem: Missing Windows App SDK workload / Windows 10 SDK

Solution: Install the "Windows application development" workload via the Visual Studio Installer, or install the Windows App SDK directly.


📝 License

MIT License - see LICENSE for details.


📮 Contact


Made with ⚡ for the Windows community

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages