forked from liquidprompt/liquidprompt
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
load: do not attempt to infer CPU utilisation from load avgerage
Liquidprompt's load feature currently assumes, incorrectly, that the load average is a percentage (it isn't) that can be converted directly to CPU utilisation (it can't). Because the load average is a gauge reading with an essentially unlimited ceiling, ensure the colouring function is passed an appropriate ceiling instead of the default value of 100. This ceiling is now set (rather arbitrarily) at 20*$LP_LOAD_THRESHOLD, meaning the "highest" colour starts being used at 18*$LP_LOAD_THRESHOLD. To handle the case where the actual load exceeds the 20*$LP_LOAD_THRESHOLD ceiling, the _lp_color_map() function is changed to apply the "highest" colour (instead of no colour) whenever the supplied value exceeds the ceiling of the scale. This change is an alternative implementation of what has already been proposed in liquidprompt#455. Closes liquidprompt#499, liquidprompt#530. Signed-off-by: Tore Anderson <[email protected]>
- Loading branch information
1 parent
5f4aeec
commit 79ef07f
Showing
3 changed files
with
29 additions
and
23 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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