style: clean class

This commit is contained in:
Alexis
2018-08-09 10:50:16 +02:00
parent a00894a5a6
commit b987668f97
8 changed files with 49 additions and 51 deletions

View File

@ -3,13 +3,12 @@
waybar::modules::Memory::Memory()
{
_label.get_style_context()->add_class("memory-widget");
_label.get_style_context()->add_class("memory");
_thread = [this] {
struct sysinfo info;
if (!sysinfo(&info)) {
double available = (double)info.freeram / (double)info.totalram;
std::cout << available << std::endl;
_label.set_text(fmt::format("{:.{}f}% ", available * 100, 1));
_label.set_text(fmt::format("{:.{}f}% ", available * 100, 0));
}
_thread.sleep_for(chrono::seconds(30));
};