| 7 | namespace waybar::modules::niri { |
| 8 | |
| 9 | Workspaces::Workspaces(const std::string& id, const Bar& bar, const Json::Value& config) |
| 10 | : AModule(config, "workspaces", id, false, false), bar_(bar), box_(bar.orientation, 0) { |
| 11 | box_.set_name("workspaces"); |
| 12 | if (!id.empty()) { |
| 13 | box_.get_style_context()->add_class(id); |
| 14 | } |
| 15 | box_.get_style_context()->add_class(MODULE_CLASS); |
| 16 | event_box_.add(box_); |
| 17 | |
| 18 | if (!gIPC) gIPC = std::make_unique<IPC>(); |
| 19 | |
| 20 | gIPC->registerForIPC("WorkspacesChanged", this); |
| 21 | gIPC->registerForIPC("WorkspaceActivated", this); |
| 22 | gIPC->registerForIPC("WorkspaceActiveWindowChanged", this); |
| 23 | gIPC->registerForIPC("WorkspaceUrgencyChanged", this); |
| 24 | |
| 25 | dp.emit(); |
| 26 | } |
| 27 | |
| 28 | Workspaces::~Workspaces() { gIPC->unregisterForIPC(this); } |
| 29 |
nothing calls this directly
no test coverage detected