cpu module: Reuse getCpuFrequency of cpu_frequency module

This commit is contained in:
Mann mit Hut
2023-07-29 15:28:26 +02:00
parent dce6a98f38
commit c45f6681b3
6 changed files with 8 additions and 78 deletions

View File

@ -19,7 +19,7 @@ waybar::modules::CpuFrequency::CpuFrequency(const std::string& id, const Json::V
auto waybar::modules::CpuFrequency::update() -> void {
// TODO: as creating dynamic fmt::arg arrays is buggy we have to calc both
auto [max_frequency, min_frequency, avg_frequency] = getCpuFrequency();
auto [max_frequency, min_frequency, avg_frequency] = CpuFrequency::getCpuFrequency();
if (tooltipEnabled()) {
auto tooltip =
fmt::format("Minimum frequency: {}\nAverage frequency: {}\nMaximum frequency: {}\n",
@ -50,7 +50,7 @@ auto waybar::modules::CpuFrequency::update() -> void {
}
std::tuple<float, float, float> waybar::modules::CpuFrequency::getCpuFrequency() {
std::vector<float> frequencies = parseCpuFrequencies();
std::vector<float> frequencies = CpuFrequency::parseCpuFrequencies();
if (frequencies.empty()) {
return {0.f, 0.f, 0.f};
}