Added changes made to the cpu module
parent
982ffde002
commit
dce6a98f38
|
@ -17,8 +17,8 @@ namespace waybar::modules {
|
||||||
class CpuFrequency : public ALabel {
|
class CpuFrequency : public ALabel {
|
||||||
public:
|
public:
|
||||||
CpuFrequency(const std::string&, const Json::Value&);
|
CpuFrequency(const std::string&, const Json::Value&);
|
||||||
~CpuFrequency() = default;
|
virtual ~CpuFrequency() = default;
|
||||||
auto update() -> void;
|
auto update() -> void override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::tuple<float, float, float> getCpuFrequency();
|
std::tuple<float, float, float> getCpuFrequency();
|
||||||
|
|
|
@ -17,8 +17,8 @@ namespace waybar::modules {
|
||||||
class CpuUsage : public ALabel {
|
class CpuUsage : public ALabel {
|
||||||
public:
|
public:
|
||||||
CpuUsage(const std::string&, const Json::Value&);
|
CpuUsage(const std::string&, const Json::Value&);
|
||||||
~CpuUsage() = default;
|
virtual ~CpuUsage() = default;
|
||||||
auto update() -> void;
|
auto update() -> void override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::tuple<std::vector<uint16_t>, std::string> getCpuUsage();
|
std::tuple<std::vector<uint16_t>, std::string> getCpuUsage();
|
||||||
|
|
|
@ -17,8 +17,8 @@ namespace waybar::modules {
|
||||||
class Load : public ALabel {
|
class Load : public ALabel {
|
||||||
public:
|
public:
|
||||||
Load(const std::string&, const Json::Value&);
|
Load(const std::string&, const Json::Value&);
|
||||||
~Load() = default;
|
virtual ~Load() = default;
|
||||||
auto update() -> void;
|
auto update() -> void override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::tuple<double, double, double> getLoad();
|
std::tuple<double, double, double> getLoad();
|
||||||
|
|
|
@ -57,5 +57,5 @@ std::tuple<double, double, double> waybar::modules::Load::getLoad() {
|
||||||
double load15 = std::ceil(load[2] * 100.0) / 100.0;
|
double load15 = std::ceil(load[2] * 100.0) / 100.0;
|
||||||
return {load1, load5, load15};
|
return {load1, load5, load15};
|
||||||
}
|
}
|
||||||
throw std::runtime_error("Can't get Load");
|
throw std::runtime_error("Can't get system load");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue