Battery event (#18)

This commit is contained in:
Alex
2018-08-13 14:05:13 +02:00
committed by GitHub
parent 01894f18cd
commit a423f7032d
9 changed files with 88 additions and 72 deletions

View File

@ -5,6 +5,7 @@
#include <fstream>
#include <iostream>
#include <fmt/format.h>
#include <sys/inotify.h>
#include "util/chrono.hpp"
#include "IModule.hpp"
@ -18,7 +19,7 @@ namespace waybar::modules {
auto update() -> void;
operator Gtk::Widget&();
private:
std::string _getIcon(uint32_t percentage);
std::string _getIcon(uint16_t percentage);
static inline const fs::path _data_dir = "/sys/class/power_supply/";
std::vector<fs::path> _batteries;
util::SleeperThread _thread;