50 lines
1022 B
C++
50 lines
1022 B
C++
#ifndef SYS_HPP
|
|
#define SYS_HPP
|
|
|
|
#include <cstdint>
|
|
#include <string>
|
|
|
|
namespace sys {
|
|
|
|
constexpr char months[][4] = {"sty", "lut", "mar", "kwi", "maj", "cze", "lip", "sie", "wrz", "paz", "lis", "gru"};
|
|
constexpr char wdays[][4] = {"Nie", "Pon", "Wto", "Sro", "Czw", "Pia", "Sob"};
|
|
|
|
struct sysSensors {
|
|
std::string hwmon;
|
|
uint16_t fan_speed[2] = {0}; // left and right cpu fans
|
|
int16_t t_sensor = 0; // ntc temp sensor
|
|
std::byte _pad[2];
|
|
};
|
|
|
|
struct Memory {
|
|
uint64_t free = 0;
|
|
uint64_t used = 0;
|
|
uint64_t total = 0;
|
|
};
|
|
|
|
struct Disk {
|
|
std::string mountpoint;
|
|
Memory usage;
|
|
};
|
|
|
|
struct TimeDate {
|
|
std::string time;
|
|
std::string date;
|
|
};
|
|
|
|
struct Network {
|
|
uint32_t download = 0;
|
|
uint32_t upload = 0;
|
|
};
|
|
|
|
void getTimeDate(TimeDate* td);
|
|
void getDisk(Disk* disk);
|
|
void getRam(Memory* mem);
|
|
void getNetwork(Network* net, const std::string& device);
|
|
int detect(sysSensors* s, const std::string& platform);
|
|
void updateSensors(sysSensors* s);
|
|
|
|
} // namespace sys
|
|
|
|
#endif
|