#pragma once #include #include #include #include #include #include #include "util/chrono.hpp" #include "ALabel.hpp" namespace waybar::modules { namespace fs = std::filesystem; class Battery : public ALabel { public: Battery(const Json::Value&); ~Battery(); auto update() -> void; private: static inline const fs::path data_dir_ = "/sys/class/power_supply/"; void worker(); util::SleeperThread thread_; std::vector batteries_; int fd_; }; }