Waybar/include/modules/cpu.hpp

22 lines
408 B
C++

#pragma once
#include "ALabel.hpp"
#include "util/sleeper_thread.hpp"
namespace waybar::modules {
class Cpu : public ALabel {
public:
Cpu(const std::string&, const Json::Value&);
virtual ~Cpu() = default;
auto update() -> void override;
private:
std::vector<std::tuple<size_t, size_t>> prev_times_;
std::string prev_state_;
util::SleeperThread thread_;
};
} // namespace waybar::modules