mirror of
https://github.com/rad4day/Waybar.git
synced 2023-12-21 10:22:59 +01:00
e1d98f0ad9
feat(cpu): show cores in tooltip
24 lines
507 B
C++
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_;
|
|
};
|
|
|
|
}
|