mirror of
https://github.com/rad4day/Waybar.git
synced 2025-07-14 23:22:31 +02:00
cpu module: Reuse getCpuFrequency of cpu_frequency module
This commit is contained in:
@ -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};
|
||||
}
|
||||
|
Reference in New Issue
Block a user