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:
Ivan Ribeiro
2026-05-19 21:21:56 +01:00
parent 05945748dc
commit 6bdafede07
3 changed files with 22 additions and 2 deletions
+12
View File
@@ -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*