mirror of
https://github.com/rad4day/Waybar.git
synced 2023-12-21 10:22:59 +01:00
fix(memory): provide better free memory approximation on old kernels
The approximation should include SReclaimable, and subtract Shmem. To prevent the parsing code from ballooning in size, this commit also refactors the parsing into a map.
This commit is contained in:
@ -17,8 +17,7 @@ class Memory : public ALabel {
|
||||
static inline const std::string data_dir_ = "/proc/meminfo";
|
||||
void parseMeminfo();
|
||||
|
||||
unsigned long memtotal_;
|
||||
unsigned long memfree_;
|
||||
std::unordered_map<std::string, unsigned long> meminfo_;
|
||||
|
||||
util::SleeperThread thread_;
|
||||
};
|
||||
|
Reference in New Issue
Block a user