Waybar/include/modules/cpu_frequency.hpp

31 lines
571 B
C++
Raw Normal View History

2022-12-21 16:45:53 +00:00
#pragma once
#include <fmt/format.h>
#include <cstdint>
#include <fstream>
#include <numeric>
#include <string>
#include <utility>
#include <vector>
2023-04-13 23:25:13 +00:00
#include "ALabel.hpp"
2022-12-21 16:45:53 +00:00
#include "util/sleeper_thread.hpp"
namespace waybar::modules {
2023-04-13 23:25:13 +00:00
class CpuFrequency : public ALabel {
2022-12-21 16:45:53 +00:00
public:
CpuFrequency(const std::string&, const Json::Value&);
~CpuFrequency() = default;
auto update() -> void;
private:
std::tuple<float, float, float> getCpuFrequency();
std::vector<float> parseCpuFrequencies();
util::SleeperThread thread_;
};
} // namespace waybar::modules