diff --git a/include/modules/xworkspaces.hpp b/include/modules/xworkspaces.hpp index e76ed350..eb54885c 100644 --- a/include/modules/xworkspaces.hpp +++ b/include/modules/xworkspaces.hpp @@ -3,6 +3,7 @@ #include #include "components/config.hpp" +#include "components/types.hpp" #include "modules/meta/static_module.hpp" #include "x11/events.hpp" #include "x11/ewmh.hpp" @@ -22,10 +23,17 @@ namespace modules { OCCUPIED, }; - struct desktop { - explicit desktop(string&& name, desktop_state state) : name(name), state(state) {} + enum class viewport_state { + NONE, + FOCUSED, + UNFOCUSED, + }; + + struct viewport { + position pos; string name; - desktop_state state{desktop_state::NONE}; + vector> desktops; + viewport_state state; label_t label; }; @@ -37,6 +45,7 @@ namespace modules { xworkspaces_module(const bar_settings& bar, const logger& logger, const config& config, string name); void setup(); + void start(); void teardown(); void handle(const evt::property_notify& evt); void update(); @@ -49,18 +58,22 @@ namespace modules { private: static constexpr const char* DEFAULT_ICON{"icon-default"}; - static constexpr const char* DEFAULT_LABEL{"%icon% %name%"}; + static constexpr const char* DEFAULT_LABEL_STATE{"%icon% %name%"}; + static constexpr const char* DEFAULT_LABEL_MONITOR{"%name%"}; - static constexpr const char* TAG_LABEL{"