mirror of
https://codeberg.org/dnkl/yambar.git
synced 2025-04-22 04:15:39 +02:00
Before this patch, the cpu module instantiated a single particle (the ‘content’ particle), with one tag ("cpu") representing the total CPU usage, and then one tag (cpuN) for each core. This makes it cumbersome to configure, since you need to explicitly reference each cpuN tag to get per-core usage. This patch rewrites this, so that ‘content’ is now a template. It’s instantiated once to represent the total CPU usage, and then once for each core. Each instance has a "cpu" tag, representing the CPU usage of that core (or total usage). It also has an "id" tag. The ID is 0..n for actual cores, and -1 for total usage. This means you can do something like this in your config: - cpu: content: map: conditions: id < 0: {string: {text: "Total: {cpu}%"}} id >= 0: {string: {text: "Core #{id}: {cpu}%"}} Closes #207 |
||
---|---|---|
.. | ||
alsa.c | ||
backlight.c | ||
battery.c | ||
clock.c | ||
cpu.c | ||
disk-io.c | ||
dwl.c | ||
foreign-toplevel.c | ||
i3-common.c | ||
i3-common.h | ||
i3-ipc.h | ||
i3.c | ||
label.c | ||
mem.c | ||
meson.build | ||
mpd.c | ||
network.c | ||
pipewire.c | ||
pulse.c | ||
removables.c | ||
river.c | ||
script.c | ||
sway-xkb.c | ||
xkb.c | ||
xwindow.c |