fix(cpu): show correct load

feat(cpu): show cores in tooltip
This commit is contained in:
Robinhuett
2018-11-11 03:11:32 +01:00
parent 7222668326
commit e1d98f0ad9
2 changed files with 53 additions and 6 deletions

View File

@ -1,7 +1,9 @@
#pragma once
#include <fmt/format.h>
#include <sys/sysinfo.h>
#include <fstream>
#include <vector>
#include <numeric>
#include "util/chrono.hpp"
#include "ALabel.hpp"
@ -12,6 +14,9 @@ class Cpu : public ALabel {
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_;
};