Repository navigation
Releases: Clearailhc/ClearPower
Release list
ClearPower v0.7.1
ClearPower 0.7.1 — easier to adopt on a machine that is not covered yet
A follow-up to 0.7.0. Nothing here changes how power is measured; it makes the charge-control work
easier to finish for a laptop that is not supported yet, and makes a bad display calibration say so.
Windows: charge control
Lenovo is verified on hardware. HP is implemented against its published root\wmi interface, on the
same adapter, but not verified on HP hardware. Dell, ASUS, MSI and Acer detect their own
interface and report it; their charge setting is not mapped, so the buttons stay hidden rather than
writing a guess.
There is no universal route to a charge limit on Windows, which is worth stating plainly because it
is the reason support is per vendor: Microsoft does define a standard ACPI _DSM for a charge
throttle, and the control-method battery exposes _BTP, but both are evaluated by the kernel and
there is no documented user-mode way to reach them. The standard root\wmi battery classes are
read-only. The only remaining universal option is a signed kernel driver, which this project does
not ship — no service, no driver, no elevation. docs/charge-control.md has the
detail, the vendor table and the contract for adding one.
Three new things make that practical:
ClearPower.exe --charge-probeprints what the machine exposes: every backend's verdict, which
vendor namespaces exist, and for the classes that look like battery or charge control their
properties and methods. It ends with a short paste-ready block — version, OS, machine vendor and
model, CPU, backends — so reporting an uncovered laptop is one step rather than a judgement call
about which part of the dump matters.ClearPower.exe --charge --dry-runprints the exact calls a command would make (thresholds,
behaviour, saved limit) and makes none of them. Writing that wrapper also fixed a real bug: a plain
read-only--chargeused to write the saved limit to the embedded controller anyway.ClearPower.exe --charge repairre-applies the saved limit. The app already did that after a
resume, because some firmware forgets the thresholds; now it can be done without restarting.
Windows: a bad calibration now says so
The panel table is built from a running maximum of (battery − SoC − memory) at each brightness level,
so a sweep taken while the machine was busy flattens at the top. The machine this was developed on
produced (50, 1.302) (75, 1.302) (100, 1.302): a "calibrated" display whose brightness does
nothing, with nothing in the UI to suggest that re-running on a quiet machine would fix it.
Three or more collapsed top levels — or a sweep screen that did not measure as white — now sets a
message in Settings saying the calibration looks unreliable and to keep the machine idle, then
calibrate again.
Also
- The apps box reuses its rows instead of rebuilding them every three seconds, so the layout no
longer re-runs for nothing while the popover is open. - The README's hardware support table now matches
docs/charge-control.md(it still said ThinkPad
only for Windows charge limits), andadapter_max_w = 0is documented as "Windows exposes no
adapter rating", not "no adapter connected".
Scope and validation
| Changed | Windows charge CLI and vendor backends, calibration reporting, the apps box, README |
| Unchanged | Power measurement, the conserved breakdown, charge behaviour on Lenovo, display calibration itself, macOS and Linux behaviour |
| Tested on | Windows 11 (16 logical cores, Energy Meter RAPL present, 225 % scale), on battery and on AC |
| Verification | Windows tests 35 → 42 plus the seven Python daemon tests; --charge, --dry-run, repair and --charge-probe run on this ThinkPad, and the dry run was confirmed to leave the saved limit and the EC untouched |
| Not verified | The HP backend has not run on HP hardware; Dell, ASUS, MSI and Acer are detection-only. A second display at a different scale was also unavailable for the cross-monitor paths (unit tested only) |
Install
- Windows —
ClearPower-Setup-0.7.1-x64.exe(per-user, no admin prompt; SmartScreen warns
because the binary is not code-signed, choose More info › Run anyway) or the portable
ClearPower-0.7.1-x64-portable.zip. - macOS — the DMG. The 0.6.0 charging helper remains compatible, so no helper update is needed.
- Linux —
clearpower_0.7.1_all.deb.
Verify downloads with the attached SHA256SUMS. Full list in
CHANGELOG.md.
ClearPower v0.7.0
ClearPower 0.7.0 — Windows apps list, popover placement and node details
Three things were visibly wrong on Windows, and the app list was wrong on every platform.
The apps list
Per-application power is the machine's dynamic CPU power shared out by CPU share, so it needs a
baseline: the package power the machine draws when nothing is running. That baseline was the raw
ten-minute minimum, and a minimum is pinned by whichever single reading happened to be lowest.
Two ways that broke:
- The first RAPL/Energy Meter read has no delta yet, so
package_wis-1. Recorded as 0 W it
became the baseline, which made every later budget the full package power for ten minutes. - The package power is smoothed. On startup, and again after wake from sleep, it ramps up from
that first value, so the samples taken while it converges sit far below the real idle draw.
Pinning one of those left a budget of about zero — and the box then said "no apps using
significant energy" while the machine was busy.
The baseline is now a low percentile of the window rather than its minimum. It tracks the quiet
end of the distribution instead of one outlier, and twenty seconds of sustained full load cannot
move it. On a desktop this matters more than it sounds: Windows always runs hundreds of processes
and the CPU never reaches a true zero, so the minimum of the window sits well below what "idle plus
the usual background" actually costs.
The box also now distinguishes "application power data unavailable" — no per-block energy
counter to attribute, so no list can be produced — from "no apps using significant energy".
Previously both looked identical, which made a broken reading look like an idle machine.
Linux (daemon/clearpowerd/sources/procs.py) and macOS
(macos/Sources/ClearPowerCore/ProcessBudget.swift) carried the identical baseline bug and are
fixed the same way, so all three platforms stay one algorithm.
Popover placement on Windows
SystemParameters.WorkArea is always the primary monitor's usable area, and it is in raw
pixels while a WPF window lays out in units scaled by the DPI of whichever monitor it is on. On the
225 % display used to verify this it reported 1280x752 while the real work area was
2880x1692 pixels = 1280x752 layout units — so the box the popover was clamped against was
2.25x too small in each direction, and on a secondary display it was simply the wrong screen. The
tray icon's physical rectangle was then converted with whatever DPI the popover was already on,
which put the window in the wrong place whenever the icon was on a different display.
The popover now:
- resolves the monitor the anchor is actually on (
MonitorFromPoint/MonitorFromWindow), - converts the anchor with that monitor's scale (
GetDpiForMonitor), - clamps inside that monitor's usable area (
GetMonitorInfo), - re-places itself when the display configuration changes (a debounced
WM_DISPLAYCHANGE) or when
the window's own DPI scale changes, and - positions itself again once
SizeToContenthas settled, which it had not when the old code read
the height.
.NET Framework defaults EnablePerMonitorDpiAwareness to off, so WPF had been ignoring the
PerMonitorV2 awareness the manifest has always declared; that is now switched on.
The settings window is constrained to its own monitor and re-fitted when display settings change,
which also recovers a window stranded on a display that has been unplugged.
Node detail card
Hovering a flow node showed a WPF ToolTip: a separate top-level window placed at the pointer.
Moving onto it fired MouseLeave on the diagram, which closed it, which put the pointer back on
the node — a visible flicker; it was also not clamped to the popover and kept the system's 250 ms
delay. It is now drawn inside the diagram next to the node, above it or below it depending on
room, exactly as the macOS and GNOME frontends do.
Also
ClearPower.exe --procsprints what the apps box is working from: the package power the
attribution was given, the CPU power, and each row's watts and CPU share. Useful when a number
looks wrong.ClearPower.exe --shot p.png --shot-hover cpurenders the popover with a node's detail card.- The apps poll no longer takes the engine lock from the UI thread, so it cannot stall the popover
behind a sampling tick. - Screen-content sampling only answers on a single-monitor system, because the calibration measures
one panel; otherwise the display stays folded into "other" instead of being scaled by the wrong
screen.
Scope and validation
| Changed | Windows popover placement, node details, apps list, settings window · apps list on all three platforms |
| Unchanged | Charge control (Windows ThinkPad / macOS helper / Linux sysfs), display calibration, runtime estimate |
| Tested on | Windows 11 (16 logical cores, Energy Meter RAPL available, 225 % scale); the macOS and Linux changes are the same arithmetic and are covered by the shared golden tests |
| Verification | Windows tests 9 → 27 (app-power attribution and per-monitor geometry); with one core fully busy the application appears in the list at 1.05 → 1.89 W as the load ramps, and the rows sum to the measured budget |
| Not verified | a real second display at a different scale was not available, so the cross-monitor paths are covered by unit tests and code review only |
Install
- Windows —
ClearPower-Setup-0.7.0-x64.exe(per-user, no admin prompt; SmartScreen warns
because the binary is not code-signed, choose More info › Run anyway) or the portable
ClearPower-0.7.0-x64-portable.zip. - macOS — the DMG. The 0.6.0 charging helper remains compatible, so no helper update is needed.
- Linux —
clearpower_0.7.0_all.deb.
Verify downloads with the attached SHA256SUMS. Full list in
CHANGELOG.md.
ClearPower v0.6.1
ClearPower 0.6.1 — display changes and input-power clarity
Connecting, disconnecting, or changing the scale of a display now refreshes the
popover's layout and Canvas scale using its actual hosting screen. Layout stays in
logical points. Tall popovers scroll on smaller screens; settings windows are
constrained to the available screen and recovered when their display disappears.
Display calibration is cancelled if the display configuration changes, and its
white surface targets the built-in display.
The adapter's hardware disable switch is now read on every sample, independently
of the helper's cached state. When disabled, the UI labels nonzero input telemetry
as an input sensor reading, with an explanation that it may include standby
draw or sensor offset rather than useful supply. Actual 0.x W readings are retained;
exactly zero input nodes are hidden. Values below 0.05 W display as <0.1 W instead
of rounding a nonzero measurement to 0.0 W. Source changes reset stale smoothing.
On the tested M3 Max running macOS 27, CHIE read back 08 (adapter disabled), while
PDTR reported approximately 0.448 W and IOKit approximately 0.444 W (20 V, 22 mA).
AlDente hid its adapter node in the same discharge state. This difference in display
does not establish physical zero input; an external meter would be required to
distinguish standby consumption from sensor offset. The previous ClearPower 0.3.0
process was also still running after the on-disk app had been updated.
Validation: 34 Swift tests, including power-source transitions, legacy fixtures,
zero/fractional input graphs, small-screen and negative-origin geometry, and real
AppKit/SwiftUI hosting-window refreshes. Physical monitor unplug/replug testing has
not been completed. The optimized app builds and passes ad-hoc signature checks.
Updating
Quit the running ClearPower process and launch the updated app. Replacing the file
alone does not update an already-running process. Check the version in Settings.
The 0.6.0 helper remains compatible, so this patch does not require reinstalling
it. Older helpers still need an update.
ClearPower v0.6.0
ClearPower 0.6.0 — macOS 27 compatibility
macOS 27 changed battery telemetry and restricted the older charging controls.
ClearPower now reads battery power from signed current × voltage, uses actual
adapter input for the power-flow diagram, and falls back to the native system
charge-limit interface. This fixes the case where a battery charging at about
35 W appeared as only 0.6 W and the adapter total was correspondingly too low.
- Battery capacity, health and runtime support the new nested
BatteryDatafields. - Live backlight sensors are used on supported models; calibration remains the
fallback elsewhere. Measured display power no longer carries the approximation mark. - M3 Max CPU power uses verified SMC rails when PMGR energy counters stall. GPU
readings remain live. Missing memory/SoC readings stay unknown, with that energy
included in “other”; delayed counter updates cannot produce huge power spikes. - Native charge limits are queried from macOS: 80, 85, 90, 95 and 100% on the tested
Mac. Old SMC backends retain their existing range. Unsupported saved limits are
reported instead of silently rounded. Native limits work during sleep; macOS may
occasionally charge to 100% to maintain its battery estimate. - Adapter discharge is detected separately from charging-enable controls. Failed
operations are reported, and cancelling discharge restores adapter power. - Application CPU enumeration, helper update notices, the diagnostic sampling loop,
and packaging with the new Swift toolchain are corrected.
Updating
Install the new app, then reinstall the helper from the update banner or
Settings → Charging. Both components must be updated for macOS 27 charging control.
macOS asks for an administrator password when replacing the helper. Quit other
charge limiters before using ClearPower's charging controls.
Compatibility and validation
The macOS app still targets macOS 14+ on Apple Silicon. On-device validation uses
an M3 Max (Mac15,10), macOS 27.0 build 26A428. CPU fallback rail mappings are verified
for M3 Max only; on other chips with stalled counters, unavailable readings remain
unknown. Private interfaces may change with future firmware updates.
Local verification: 23 Swift tests (including legacy golden fixtures and macOS 27
regressions), 7 Linux tests, and a 16-snapshot live CPU workload trace with conserved
power flows. The native interface was verified by setting 95%, reading it back, then
restoring the previous 100% setting. Administrator/helper installation is separate
from the unprivileged telemetry and native-interface tests.
The release includes macOS, Linux and Windows packages. This update changes the
macOS implementation; Linux and Windows retain their existing behavior.
ClearPower v0.5.2
A fan reading could outlive the sampling behind it. Fixed.
Fixed
- Fans no longer show a stale value. Temperatures and fans are read only while the popover
is open (that is what keeps the daemon idle the rest of the time), and the last reading was
being served as if it were live: a fan that had stopped still showed its old rpm — e.g.
2200— the next time the popover opened. The fan fields now read-1(unknown) whenever
nothing is sampling, and the first sample after the popover opens reads immediately instead
of waiting out the 3 s cache. Temperatures keep their last value while cold because
temp_cpuis recorded in history. Linux and macOS; Windows has no fan sensor (it needs a
kernel driver) and already reported-1. - A stopped fan is now visible as
0 rpminstead of vanishing from the temperature line,
which made "stopped" and "unknown" look identical. The-1sentinel stays hidden, so a
machine without a fan sensor shows no fan entry rather than a fake zero.
Scope of this release
| Platforms | Linux (GNOME Shell 48–50), macOS 14+ (Apple Silicon), Windows 11 x64 |
| Packages | clearpower_0.5.2_all.deb, ClearPower-0.5.2-arm64.dmg, ClearPower-Setup-0.5.2-x64.exe, ClearPower-0.5.2-x64-portable.zip |
| Unchanged | The power breakdown, charge control, runtime estimate, display calibration and the Snapshot contract. Only the fan/temperature line in the open popover behaves differently. |
Install
Same as 0.5.1 — see the README. On Linux:
sudo apt install ./clearpower_0.5.2_all.deb, then log out and back in once so the new
extension loads. On macOS / Windows the app updates in place; the Windows build is unsigned,
so SmartScreen still warns.
ClearPower v0.5.1
Battery charge control and an honest, live power-flow view for laptops — now on Windows too.
Scope of this release
| New platform | Windows 11 x64 (Windows 10 runs with a single "system" node: no Energy Meter Interface) |
| Package | ClearPower-Setup-0.5.1-x64.exe (per-user installer, no admin), ClearPower-0.5.1-x64-portable.zip (single exe) |
| Full feature set | Intel laptops (RAPL via the Windows 11 Energy Meter Interface) that are ThinkPads with the Lenovo Power Manager driver (charge thresholds) |
| Partial | No Energy Meter → single "system" node, no display calibration · No Lenovo Power Manager → charge controls hidden · Discharge is never available on Windows · no temperatures / fans |
| Tested on | ThinkPad X14 Gen 1 (Core Ultra X7 358H, Samsung OLED), Windows 11 24H2 build 26200 |
| Unchanged | Linux .deb and macOS DMG from v0.3.0 (one Linux fix: per-app attribution budget) |
Install (Windows)
Run the installer (SmartScreen will warn — the binary is not code-signed; choose More info › Run anyway) or unzip the portable build. Click the tray icon for the popover; Settings › Calibrate once on battery so the display gets its own number.
Highlights
- Same popover, same numbers: the power breakdown is measured from the same RAPL domains as on Linux, and the battery is the whole-machine truth on battery. On AC the total is an estimate (≈) built from SoC + memory + the baseline learnt during calibration — Windows exposes no platform-power sensor.
- Charge limit 80/90/100 by click, or any value 50–100 in settings, written to the ThinkPad's embedded controller through Lenovo's own Power Manager interface — no driver, no elevation. Top Up runs to 100 % and reverts.
- Windows power mode (Best power efficiency / Balanced / Best performance) from the popover.
- English / Chinese UI, light / dark theme, per-monitor DPI.
Also in 0.5.1
0.5.0 was tagged but never produced packages — its release build failed on macOS. 0.5.1 is
that same release, built: the macOS job now runs on a Swift 6 toolchain, and the SwiftUI
Canvas layout code no longer mixes Double with CGFloat in ways that toolchain rejects.
Nothing in the app's behaviour changed.
Full list in CHANGELOG.md. Verify downloads with the attached SHA256SUMS.
ClearPower 0.3.0 — macOS (Apple Silicon)
macOS (Apple Silicon) — first release
Native menu bar app with the same popover as the Linux version: charge limit / Top Up / Discharge, a power-flow diagram that adds up (adapter · battery → system → CPU · GPU · SoC · memory · display · other), runtime estimate, temperatures, fans, power modes, apps using significant energy. English and Chinese.
Install (macOS 14+, Apple Silicon): open the DMG, drag ClearPower to Applications.
The app is not notarized yet, so on first launch go to System Settings › Privacy & Security › Open Anyway (or xattr -dr com.apple.quarantine /Applications/ClearPower.app). Then click Install… in the popover: one administrator prompt installs the small charge-control helper. Full notes in macos/README.md.
Quit AlDente / batt / other charge limiters first — they fight over the same SMC keys.
Both frontends: sink nodes now show their name under the glyph and a hover tooltip explains what each node contains; clearer GPU and memory glyphs.
Fixed: bat_w was zeroed while discharging, so the system total never used the battery's own reading and the battery never appeared as a second source next to a weak adapter.
SHA-256 ClearPower-0.3.0-arm64.dmg: bc60ad1be9d3fc7e5dd7bf87d680d7f1c6de62ea70da66ce6b461e3444407ac4
ClearPower v0.2.0 — Linux (GNOME 48–50)
Battery charge control and an honest, live power-flow view for Linux laptops — inspired by AlDente.
Scope of this release
| Platform | Linux with GNOME Shell 48, 49 or 50 (Wayland or X11). Ubuntu 24.10+ / 26.04, Fedora 42+, Arch |
| Package | clearpower_0.2.0_all.deb for Debian/Ubuntu; other distros: ./install.sh from source |
| Full feature set | Intel laptops with RAPL (intel-rapl powercap) and a ThinkPad-style battery interface (charge_control_*_threshold, charge_behaviour) |
| Partial | No RAPL → single "system" node, no display calibration · No threshold interface → charge controls hidden · No force-discharge → Discharge hidden |
| Tested on | ThinkPad X14 Gen 1 (Core Ultra X7 358H, Samsung ATNA40HQ10 OLED), Ubuntu 26.04.1, GNOME Shell 50.1 |
| Not yet | AMD RAPL, Windows, macOS — Windows is next |
Install
sudo apt install ./clearpower_0.2.0_all.debLog out and back in once, then open ClearPower (app grid) → Calibrate so the display gets its own measured number.
Highlights
- Power breakdown that always adds up: CPU · GPU · SoC · memory · display · other.
- Display power measured on your own panel (white-screen brightness sweep) and scaled by live screen content — on this OLED, full white at 100 % is 7.6 W, a dark desktop 0.4 W.
- Runtime estimate from the battery's energy counter over a selectable window.
- Charge limit 80/90/100 by click, or any value 50–100 in settings; Top Up and Discharge with automatic revert.
- English / Chinese UI.
Full list in CHANGELOG.md. Verify the download with the attached SHA256SUMS.