#pragma once #include #include #include #include #include #include #include "ALabel.hpp" #include "gtkmm/box.h" #include "gtkmm/image.h" #include "gtkmm/label.h" namespace waybar::modules { class UPower : public AModule { public: UPower(const std::string &, const Json::Value &); ~UPower(); auto update() -> void; private: static void deviceAdded_cb(UpClient *client, UpDevice *device, gpointer data); static void deviceRemoved_cb(UpClient *client, const gchar *object_path, gpointer data); static void deviceNotify_cb(gpointer data); void removeDevice(const std::string devicePath); void addDevice(UpDevice *device); void setDisplayDevice(); void resetDevices(); static void clicked(); Gtk::Box box_; Gtk::Image icon_; Gtk::Label label_; UpClient *client = NULL; UpDevice *displayDevice = NULL; std::map devices; }; } // namespace waybar::modules