Repository navigation
Conversation
Add 'watt' to the battery colorFormats so Power Rate (and the battery value shown in the panel) uses battery-colors, like Percentage already does. Per-sensor scales for Power Rate become available in prefs, and the "All sensors" scale now covers it too. Update the battery-colors schema description accordingly.
Apply battery threshold colors to power rate
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
Battery threshold colors (
battery-colors) only apply to Percentage. The Power Rate sensor (formatwatt), which is also the battery value shown in the top bar, never gets a color, becausehelpers/catalog.jslists only'percent'in the batterycolorFormats.So:
Changes
helpers/catalog.js: add'watt'to the batterycolorFormats. Power Rate, including the battery value in the panel, now usesbattery-colors: both the "All sensors" scale and a per-sensor scale are applied, and Power Rate is listed in "Add Color Scale" whether or not it is pinned.schemas/org.gnome.shell.extensions.vitals.gschema.xml: thebattery-colorsdescription now mentions power rate (watts). The key's type and default are unchanged, so existing settings keep working (scales already saved for Power Rate start to apply).Notes
value >= thresholdrule, so negative breakpoints can color discharge rates.glib-compile-schemas --strict --dry-run schemas/.