Waybar: Add a warn for cpu and mem usage.

This commit is contained in:
Dmitry Voronin 2024-11-08 08:21:49 +03:00
parent 6ad96a7018
commit 1313311da8
Signed by: voronind
SSH key fingerprint: SHA256:3kBb4iV2ahufEBNq+vFbUe4QYfHt98DHQjN7QaptY9k
2 changed files with 55 additions and 30 deletions

View file

@ -132,6 +132,7 @@ in {
interval = refreshInterval;
on-click = "foot -e bash -c btop";
on-click-right = "powersave toggle";
states.critical = 80;
tooltip = false;
};
memory = {
@ -139,6 +140,7 @@ in {
interval = refreshInterval;
on-click = "foot -e bash -c btop";
on-click-right = "powersave toggle";
states.critical = 80;
};
temperature = {
critical-threshold = 80;
@ -160,10 +162,12 @@ in {
"group/hardware" = {
orientation = "horizontal";
modules = [
"custom/tag1"
"cpu"
"temperature"
"memory"
"custom/powersave"
"custom/tag2"
];
};
"custom/display" = {
@ -174,5 +178,11 @@ in {
return-type = "json";
signal = 4;
};
"custom/tag1" = {
exec = "echo ";
};
"custom/tag2" = {
exec = "echo ";
};
};
}

View file

@ -9,6 +9,18 @@ in {
# This way I am forced to apply the padding to children of each group
# instead of the whole group.
text = ''
/* See the ISSUE above. */
#custom-tag1,
#battery {
padding-left: ${paddingH};
}
#custom-tag2,
#custom-powerlimit {
padding-right: ${paddingH};
}
/* Padding for global widgets. */
#clock,
#custom-display,
#language,
@ -17,33 +29,17 @@ in {
#scratchpad,
#tray {
padding: ${paddingV} ${paddingH};
border-top: ${toString config.module.style.window.border}px solid transparent;
border-bottom: ${toString config.module.style.window.border}px solid transparent;
}
#cpu,
#battery {
padding-left: ${paddingH};
}
#custom-powersave,
#custom-powerlimit {
padding-right: ${paddingH};
}
#clock {
font-weight: bold;
}
/* Padding for combined widgets. */
#custom-powerlimit,
#custom-powersave,
#memory,
#temperature {
padding-left: 4px;
border-top: ${toString config.module.style.window.border}px solid transparent;
border-bottom: ${toString config.module.style.window.border}px solid transparent;
}
/* Hover style. */
#batteryinfo:hover,
#clock:hover,
#custom-display:hover,
@ -57,15 +53,30 @@ in {
background-color: rgba(${config.module.style.color.border-r},${config.module.style.color.border-g},${config.module.style.color.border-b},${toString config.module.style.opacity.desktop});
}
/* Critical state. */
#battery,
#cpu,
#custom-display,
#memory,
#pulseaudio,
#temperature,
#tray {
border-top: ${toString config.module.style.window.border}px solid transparent;
border-bottom: ${toString config.module.style.window.border}px solid transparent;
}
#battery.critical,
#cpu.critical,
#custom-display.modified,
#memory.critical,
#pulseaudio.muted,
#pulseaudio.source-muted,
#battery.critical,
#temperature.critical,
#tray.needs-attention,
#custom-display.modified {
#tray.needs-attention {
border-top: ${toString config.module.style.window.border}px solid #${config.module.style.color.accent};
}
/* Widget-specific styling. */
#workspaces button {
padding: ${paddingV} 4px;
border-top: ${toString config.module.style.window.border}px solid transparent;
@ -76,5 +87,9 @@ in {
#workspaces button.focused {
border-top: ${toString config.module.style.window.border}px solid #${config.module.style.color.accent};
}
#clock {
font-weight: bold;
}
'';
}