Files
waybar/include/modules/load.hpp
Mann mit Hut 729564cc27 Introduced separate load module
The module provides the three system load averages. This is an
improvement compared what you can do with the cpu module: cpu
only provides the one minute sample and the state of the cpu module is
derived from the cpu usage which messes up the formating of the load
average. Also, at least on modern Linux systems, the load of a system
takes much more than the cpu utilization into account and it should
therefore live in a separate module.
2023-09-13 21:56:30 +02:00

30 lines
500 B
C++

#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 Load : public AButton {
public:
Load(const std::string&, const Json::Value&);
~Load() = default;
auto update() -> void;
private:
std::tuple<double, double, double> getLoad();
util::SleeperThread thread_;
};
} // namespace waybar::modules