#pragma once #include #include #include #include #include #include #include #include "AGraph.hpp" #include "util/sleeper_thread.hpp" namespace waybar::modules { class CpuGraph : public AGraph { public: CpuGraph(const std::string&, const Json::Value&); virtual ~CpuGraph() = default; auto update() -> void override; private: static constexpr const char* MODERATE_CLASS = "cpu-moderate"; static constexpr const char* HIGH_CLASS = "cpu-high"; static constexpr const char* INTENSIVE_CLASS = "cpu-intensive"; std::vector> prev_times_; util::SleeperThread thread_; }; } // namespace waybar::modules