2022-12-21 16:44:11 +00:00
|
|
|
#pragma once
|
|
|
|
|
2023-04-13 23:25:13 +00:00
|
|
|
#include "ALabel.hpp"
|
2022-12-21 16:44:11 +00:00
|
|
|
#include "util/sleeper_thread.hpp"
|
|
|
|
|
|
|
|
namespace waybar::modules {
|
|
|
|
|
2023-04-13 23:25:13 +00:00
|
|
|
class Load : public ALabel {
|
2022-12-21 16:44:11 +00:00
|
|
|
public:
|
|
|
|
Load(const std::string&, const Json::Value&);
|
2023-07-29 12:52:59 +00:00
|
|
|
virtual ~Load() = default;
|
|
|
|
auto update() -> void override;
|
2022-12-21 16:44:11 +00:00
|
|
|
|
2023-07-29 14:02:36 +00:00
|
|
|
// This is a static member because it is also used by the cpu module.
|
|
|
|
static std::tuple<double, double, double> getLoad();
|
|
|
|
|
2022-12-21 16:44:11 +00:00
|
|
|
private:
|
|
|
|
util::SleeperThread thread_;
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace waybar::modules
|