mirror of
https://github.com/rad4day/Waybar.git
synced 2023-12-21 10:22:59 +01:00
style: clean class
This commit is contained in:
@ -3,15 +3,15 @@
|
||||
|
||||
waybar::modules::Cpu::Cpu()
|
||||
{
|
||||
_label.get_style_context()->add_class("cpu-widget");
|
||||
_label.get_style_context()->add_class("cpu");
|
||||
_thread = [this] {
|
||||
struct sysinfo info;
|
||||
if (!sysinfo(&info)) {
|
||||
float f_load = 1.f / (1 << SI_LOAD_SHIFT);
|
||||
_label.set_text(fmt::format("{:.{}f}% ",
|
||||
info.loads[0] * f_load * 100 / get_nprocs(), 1));
|
||||
info.loads[0] * f_load * 100 / get_nprocs(), 0));
|
||||
}
|
||||
_thread.sleep_for(chrono::seconds(30));
|
||||
_thread.sleep_for(chrono::seconds(10));
|
||||
};
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user