#pragma once #include #include #include #include #include "bar.hpp" #include "config.hpp" struct zwlr_layer_shell_v1; struct zwp_idle_inhibitor_v1; struct zwp_idle_inhibit_manager_v1; namespace waybar { class Client { public: static Client *inst(); int main(int argc, char *argv[]); void reset(); Glib::RefPtr gtk_app; Glib::RefPtr gdk_display; struct wl_display * wl_display = nullptr; struct wl_registry * registry = nullptr; struct zwlr_layer_shell_v1 * layer_shell = nullptr; struct zxdg_output_manager_v1 * xdg_output_manager = nullptr; struct zwp_idle_inhibit_manager_v1 *idle_inhibit_manager = nullptr; std::vector> bars; Config config; std::string bar_id; private: Client() = default; const std::string getStyle(const std::string &style); void bindInterfaces(); void handleOutput(struct waybar_output &output); auto setupCss(const std::string &css_file) -> void; struct waybar_output & getOutput(void *); std::vector getOutputConfigs(struct waybar_output &output); static void handleGlobal(void *data, struct wl_registry *registry, uint32_t name, const char *interface, uint32_t version); static void handleGlobalRemove(void *data, struct wl_registry *registry, uint32_t name); static void handleOutputLogicalSize(void *, struct zxdg_output_v1 *, int32_t, int32_t); static void handleOutputDone(void *, struct zxdg_output_v1 *); static void handleOutputName(void *, struct zxdg_output_v1 *, const char *); static void handleOutputDescription(void *, struct zxdg_output_v1 *, const char *); void handleMonitorAdded(Glib::RefPtr monitor); void handleMonitorRemoved(Glib::RefPtr monitor); void handleDeferredMonitorRemoval(Glib::RefPtr monitor); Glib::RefPtr style_context_; Glib::RefPtr css_provider_; std::list outputs_; }; } // namespace waybar