MCPcopy Create free account
hub / github.com/Alexays/Waybar / Workspaces

Method Workspaces

src/modules/niri/workspaces.cpp:9–26  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7namespace waybar::modules::niri {
8
9Workspaces::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
28Workspaces::~Workspaces() { gIPC->unregisterForIPC(this); }
29

Callers

nothing calls this directly

Calls 3

emptyMethod · 0.80
registerForIPCMethod · 0.45
emitMethod · 0.45

Tested by

no test coverage detected