MCPcopy Create free account
hub / github.com/WayfireWM/wayfire / init

Method init

plugins/ipc/ipc.cpp:345–366  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

343
344 public:
345 void init() override
346 {
347 char *pre_socket = getenv("_WAYFIRE_SOCKET");
348 const auto& dname = wf::get_core().wayland_display;
349 pid_t pid = getpid();
350 const char *runtime_dir = getenv("XDG_RUNTIME_DIR");
351
352 std::string socket;
353 if (pre_socket)
354 {
355 socket = pre_socket;
356 } else if (runtime_dir)
357 {
358 socket = std::string(runtime_dir) + "/wayfire-" + dname + "-" + ".socket";
359 } else
360 {
361 socket = "/tmp/wayfire-" + dname + "-" + std::to_string(pid) + ".socket";
362 }
363
364 setenv("WAYFIRE_SOCKET", socket.c_str(), 1);
365 server->init(socket);
366 }
367
368 bool is_unloadable() override
369 {

Callers

nothing calls this directly

Calls 1

initMethod · 0.45

Tested by

no test coverage detected