feat(cpu): add {icons} format replacement for all per-core icons
Concatenates all per-core icons into a single {icons} placeholder,
so configs work across machines with different core counts without
manually specifying {icon0}{icon1}...{iconN}.
Closes #4240
This commit is contained in:
@@ -106,6 +106,8 @@ The *cpu* module displays the current CPU utilization.
|
||||
|
||||
*{icon*{n}*}*: Icon for CPU core n usage. Use like {icon0}.
|
||||
|
||||
*{icon0}{icon1}{icon2}{icon3}*: All per-core icons concatenated. Equivalent to {icon0}{icon1}...{icon*N*} but adapts to the number of cores automatically.
|
||||
|
||||
# EXAMPLES
|
||||
|
||||
Basic configuration:
|
||||
@@ -128,6 +130,16 @@ CPU usage per core rendered as icons:
|
||||
},
|
||||
```
|
||||
|
||||
Automatically determine number of icons according to number of logical cores:
|
||||
|
||||
```
|
||||
"cpu": {
|
||||
"interval": 1,
|
||||
"format": "{icons} {usage:>2}% ",
|
||||
"format-icons": ["▁", "▂", "▃", "▄", "▅", "▆", "▇", "█"],
|
||||
},
|
||||
```
|
||||
|
||||
# STYLE
|
||||
|
||||
- *#cpu*
|
||||
|
||||
Reference in New Issue
Block a user