From cf3902b35edd2adb637baeb2f13c9c33e3ad7340 Mon Sep 17 00:00:00 2001 From: funman300 Date: Thu, 23 Apr 2026 10:25:39 -0700 Subject: [PATCH] waybar: add CPU usage/temp with color states and per-core tooltip --- waybar/config.jsonc | 24 +++++++++++++++++++++++- waybar/style.css | 17 +++++++++++++++++ 2 files changed, 40 insertions(+), 1 deletion(-) diff --git a/waybar/config.jsonc b/waybar/config.jsonc index 4601aab..0adca65 100644 --- a/waybar/config.jsonc +++ b/waybar/config.jsonc @@ -5,7 +5,29 @@ "modules-left": ["niri/workspaces"], "modules-center": ["clock"], - "modules-right": ["custom/power-profile", "custom/fan-profile", "pulseaudio", "network", "battery", "tray"], + "modules-right": ["cpu", "temperature", "custom/power-profile", "custom/fan-profile", "pulseaudio", "network", "battery", "tray"], + + "cpu": { + "format": " {usage}%", + "format-tooltip": "{usage}% total\n{icon0} {icon1} {icon2} {icon3}\n{icon4} {icon5} {icon6} {icon7}\n{icon8} {icon9} {icon10} {icon11}", + "format-icons": ["▁", "▂", "▃", "▄", "▅", "▆", "▇", "█"], + "interval": 3, + "states": { + "warning": 60, + "critical": 85 + } + }, + + "temperature": { + "thermal-zone": 0, + "format": " {temperatureC}°C", + "critical-threshold": 80, + "format-critical": " {temperatureC}°C", + "states": { + "warm": 60, + "critical": 80 + } + }, "custom/power-profile": { "exec": "~/.local/bin/power-profile", diff --git a/waybar/style.css b/waybar/style.css index a119ff0..58548c2 100644 --- a/waybar/style.css +++ b/waybar/style.css @@ -18,6 +18,7 @@ window#waybar { } #clock, #battery, #network, #pulseaudio, +#cpu, #temperature, #custom-power-profile, #custom-fan-profile { padding: 0 12px; } @@ -37,3 +38,19 @@ window#waybar { #battery.critical { color: #cc6666; } + +#cpu.warning { + color: #f0c674; +} + +#cpu.critical { + color: #cc6666; +} + +#temperature.warm { + color: #f0c674; +} + +#temperature.critical { + color: #cc6666; +}