Update cpu_usage.py
Add color option on cpu_usage.py
This commit is contained in:
parent
73b6d96e20
commit
12a9aeebb9
@ -28,12 +28,14 @@ class CpuUsage(IntervalModule):
|
|||||||
format_all = "{core}:{usage:02}%"
|
format_all = "{core}:{usage:02}%"
|
||||||
exclude_average = False
|
exclude_average = False
|
||||||
interval = 1
|
interval = 1
|
||||||
|
color = None
|
||||||
settings = (
|
settings = (
|
||||||
("format", "format string."),
|
("format", "format string."),
|
||||||
("format_all", ("format string used for {usage_all} per core. "
|
("format_all", ("format string used for {usage_all} per core. "
|
||||||
"Available formaters are {core} and {usage}. ")),
|
"Available formaters are {core} and {usage}. ")),
|
||||||
("exclude_average", ("If True usage average of all cores will "
|
("exclude_average", ("If True usage average of all cores will "
|
||||||
"not be in format_all."))
|
"not be in format_all.")),
|
||||||
|
("color", "HTML color code #RRGGBB")
|
||||||
)
|
)
|
||||||
|
|
||||||
def init(self):
|
def init(self):
|
||||||
@ -117,5 +119,6 @@ class CpuUsage(IntervalModule):
|
|||||||
usage['usage'] = usage['usage_cpu']
|
usage['usage'] = usage['usage_cpu']
|
||||||
|
|
||||||
self.output = {
|
self.output = {
|
||||||
"full_text": self.format.format_map(usage)
|
"full_text": self.format.format_map(usage),
|
||||||
|
"color": self.color
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user