Repository navigation
Conversation
Preferences offered a color scale for a pinned frequency sensor, but the panel never applied it: processor colors only accepted the percent format. Frequencies now take a per-sensor scale. Thresholds are in GHz, because the displayed unit changes with the value (400 MHz, 4.5 GHz). The All sensors scale of the processor page stays on usage, so a 0-100 % scale does not color a frequency. The scale title shows the unit.
This branch has not been deployed
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.
Problem
In Processor preferences, Add Color Scale lists a frequency sensor once it is pinned to the panel (for example Max frequency). You can set breakpoints, but the panel never colors the value:
colorsKeyForSensor()only accepts thepercentformat for the processor group, and frequencies usehertz.Even with
hertzaccepted, the thresholds would compare the displayed number. That number changes unit with the value: 400 MHz gives400, 4.5 GHz gives4.5. So a "red under 1" rule would not work.My use case: show the fastest core in red when the firmware cuts the power limit and the CPU falls to 400 MHz.
Change
helpers/catalog.js: newsensorColorFormatsfield. These formats take a per-sensor scale only. The processor group getssensorColorFormats: ['hertz'].0 → green, 80 → redusage scale would color every frequency green.getUsageColor()gets auseGroupWideflag for that.values.js: frequency thresholds are in GHz, whatever unit the text shows.prefs.js: the scale title shows the unit (Frequency (fastest core) (GHz) colors). Palette titles are refreshed when sensor discovery ends, so the unit (and unavailable) is right even if the page was opened in the first 2 seconds.GPU frequencies are not changed: the GPU group still colors
percentonly.Testing
A GJS script that runs
Values._legible()with fake settings:Scale:
0 → red, 1 → greenon the fastest core, plus an All sensors usage scale0 → green, 80 → red.Not tested yet in a running shell or in the preferences window.