support format-icon for cpu und memory

This commit is contained in:
Tobias Bengfort
2021-08-23 07:30:07 +02:00
parent ab38f13052
commit 7b4b5e55a2
4 changed files with 14 additions and 0 deletions

View File

@ -26,9 +26,11 @@ auto waybar::modules::Cpu::update() -> void {
event_box_.hide();
} else {
event_box_.show();
auto icons = std::vector<std::string>{state};
label_.set_markup(fmt::format(format,
fmt::arg("load", cpu_load),
fmt::arg("usage", cpu_usage),
fmt::arg("icon", getIcon(cpu_usage, icons)),
fmt::arg("max_frequency", max_frequency),
fmt::arg("min_frequency", min_frequency),
fmt::arg("avg_frequency", avg_frequency)));

View File

@ -38,8 +38,10 @@ auto waybar::modules::Memory::update() -> void {
event_box_.hide();
} else {
event_box_.show();
auto icons = std::vector<std::string>{state};
label_.set_markup(fmt::format(format,
used_ram_percentage,
fmt::arg("icon", getIcon(used_ram_percentage, icons)),
fmt::arg("total", total_ram_gigabytes),
fmt::arg("percentage", used_ram_percentage),
fmt::arg("used", used_ram_gigabytes),