waybar: add CPU usage/temp with color states and per-core tooltip

This commit is contained in:
funman300
2026-04-23 10:25:39 -07:00
parent fd2abd5fae
commit cf3902b35e
2 changed files with 40 additions and 1 deletions
+23 -1
View File
@@ -5,7 +5,29 @@
"modules-left": ["niri/workspaces"], "modules-left": ["niri/workspaces"],
"modules-center": ["clock"], "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": { "custom/power-profile": {
"exec": "~/.local/bin/power-profile", "exec": "~/.local/bin/power-profile",
+17
View File
@@ -18,6 +18,7 @@ window#waybar {
} }
#clock, #battery, #network, #pulseaudio, #clock, #battery, #network, #pulseaudio,
#cpu, #temperature,
#custom-power-profile, #custom-fan-profile { #custom-power-profile, #custom-fan-profile {
padding: 0 12px; padding: 0 12px;
} }
@@ -37,3 +38,19 @@ window#waybar {
#battery.critical { #battery.critical {
color: #cc6666; color: #cc6666;
} }
#cpu.warning {
color: #f0c674;
}
#cpu.critical {
color: #cc6666;
}
#temperature.warm {
color: #f0c674;
}
#temperature.critical {
color: #cc6666;
}