mirror of
https://github.com/rad4day/Waybar.git
synced 2025-07-13 22:52:30 +02:00
Introduce cpu_frequency module
This commit is contained in:
@ -38,6 +38,7 @@
|
||||
#endif
|
||||
#if defined(HAVE_CPU_LINUX) || defined(HAVE_CPU_BSD)
|
||||
#include "modules/cpu.hpp"
|
||||
#include "modules/cpu_frequency.hpp"
|
||||
#include "modules/load.hpp"
|
||||
#endif
|
||||
#include "modules/idle_inhibitor.hpp"
|
||||
|
30
include/modules/cpu_frequency.hpp
Normal file
30
include/modules/cpu_frequency.hpp
Normal file
@ -0,0 +1,30 @@
|
||||
#pragma once
|
||||
|
||||
#include <fmt/format.h>
|
||||
|
||||
#include <cstdint>
|
||||
#include <fstream>
|
||||
#include <numeric>
|
||||
#include <string>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
#include "AButton.hpp"
|
||||
#include "util/sleeper_thread.hpp"
|
||||
|
||||
namespace waybar::modules {
|
||||
|
||||
class CpuFrequency : public AButton {
|
||||
public:
|
||||
CpuFrequency(const std::string&, const Json::Value&);
|
||||
~CpuFrequency() = default;
|
||||
auto update() -> void;
|
||||
|
||||
private:
|
||||
std::tuple<float, float, float> getCpuFrequency();
|
||||
std::vector<float> parseCpuFrequencies();
|
||||
|
||||
util::SleeperThread thread_;
|
||||
};
|
||||
|
||||
} // namespace waybar::modules
|
Reference in New Issue
Block a user