waybar/include/modules/cpu.hpp
Robinhuett e1d98f0ad9 fix(cpu): show correct load
feat(cpu): show cores in tooltip
2018-11-11 03:11:32 +01:00

24 lines
507 B
C++

#pragma once
#include <fmt/format.h>
#include <fstream>
#include <vector>
#include <numeric>
#include "util/chrono.hpp"
#include "ALabel.hpp"
namespace waybar::modules {
class Cpu : public ALabel {
public:
Cpu(const Json::Value&);
auto update() -> void;
private:
static inline const std::string data_dir_ = "/proc/stat";
std::vector< std::tuple<size_t, size_t> > parseCpuinfo();
std::vector< std::tuple<size_t, size_t> > prevTimes_;
waybar::util::SleeperThread thread_;
};
}