1
0
Fork 0
mirror of https://github.com/polybar/polybar.git synced 2024-10-27 05:23:39 -04:00
polybar/include/modules/memory.hpp

33 lines
789 B
C++
Raw Normal View History

#pragma once
2016-05-19 10:41:06 -04:00
#include <atomic>
#include "modules/base.hpp"
#include "drawtypes/bar.hpp"
#include "drawtypes/icon.hpp"
#include "drawtypes/label.hpp"
namespace modules
{
DefineModule(MemoryModule, TimerModule)
{
static constexpr auto TAG_LABEL = "<label>";
static constexpr auto TAG_BAR_USED = "<bar-used>";
static constexpr auto TAG_BAR_FREE = "<bar-free>";
2016-05-19 10:41:06 -04:00
std::unique_ptr<drawtypes::Bar> bar_used;
std::unique_ptr<drawtypes::Bar> bar_free;
std::unique_ptr<drawtypes::Label> label;
std::unique_ptr<drawtypes::Label> label_tokenized;
std::atomic<int> percentage_used;
std::atomic<int> percentage_free;
public:
2016-06-20 21:59:43 -04:00
explicit MemoryModule(std::string name);
2016-05-19 10:41:06 -04:00
bool update();
2016-06-20 21:59:43 -04:00
bool build(Builder *builder, std::string tag);
2016-05-19 10:41:06 -04:00
};
}