Add taskbar CPU/RAM stats and CPU temperature#812
Open
GiangQuan wants to merge 11 commits into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds optional CPU/RAM stats to the taskbar widget, with optional CPU temperature display and a few compact styling controls for the taskbar text.
Preview
What changed
CPU 18%RAM 64%CPU 18% · 72°CHow CPU/RAM stats work
CPU usage is sampled from Windows
GetSystemTimes. The widget stores the previous idle/kernel/user values, compares them with the next sample, and formats the busy percentage as a compact line. RAM usage comes fromGlobalMemoryStatusExand uses Windows' memory load percentage.The display updates on a lightweight one-second timer while the taskbar stats option is enabled. When the option is disabled, the timer stops.
How CPU temperature works
CPU temperature is optional and shown only when enabled in settings.
Temperature is read in this order:
For MSI Afterburner, the reader opens the
MAHMSharedMemorymemory map and prefers the known CPU temperature source id (0x00000080). If that source id is unavailable, it can also use monitoring entries whose name looks like CPU temperature. Invalid readings such asNaN,0, negative values, or extreme values above 125C are ignored.For LibreHardwareMonitor, the reader opens CPU hardware sensors and prefers package-style sensors such as
CPU Package,Tctl/Tdie,Package,CPU Die, andCore Max. If none of those are available, it falls back to the hottest valid CPU temperature sensor.Notes for review
--°Cwhen no supported sensor source is available.CPU 18% · 72°Care not clipped.Validation
dotnet run --project FluentFlyoutWPF.Tests\FluentFlyoutWPF.Tests.csprojdotnet build FluentFlyoutWPF\FluentFlyout.csproj -p:Platform=x64 -o %TEMP%\FluentFlyout-pr-cpu-ram-temp-buildBoth commands pass locally. Existing nullable warnings remain, but no build errors are introduced.