#pragma once #include #include #include #include "AModule.hpp" #include "bar.hpp" #include "modules/hyprland/backend.hpp" #include "util/json.hpp" #include #include #include namespace waybar::modules::hyprland { class Workspaces : public AModule, public sigc::trackable { public: Workspaces(const std::string&, const waybar::Bar&, const Json::Value&); ~Workspaces() = default; auto update() -> void; private: void onEvent(const std::string&); bool handleScroll(GdkEventScroll*); void configOnLaunch(const Json::Value&); void updateButtons(); void parseInitHyprlandWorkspaces(); Gtk::Button& addButton(const std::string&); std::string getIcon(const std::string&); std::deque getAllSortedWS(); bool isNumber(const std::string&); bool needReorder = false; Gtk::Box box_; const Bar& bar_; std::deque workspaces; std::deque persistentWorkspaces; std::unordered_map buttons_; std::string focusedWorkspace; std::mutex mutex_; }; } // namespace waybar::modules::sway