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

Method get_plugin_paths

src/core/plugin-loader.cpp:298–332  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

296}
297
298std::vector<std::string> wf::get_plugin_paths()
299{
300 std::vector<std::string> plugin_prefixes;
301 if (char *plugin_path = getenv("WAYFIRE_PLUGIN_PATH"))
302 {
303 std::stringstream ss(plugin_path);
304 std::string entry;
305 while (std::getline(ss, entry, ':'))
306 {
307 plugin_prefixes.push_back(entry);
308 }
309 }
310
311 // also add XDG specific paths
312 std::string xdg_data_dir;
313 char *c_xdg_data_dir = std::getenv("XDG_DATA_HOME");
314 char *c_user_home = std::getenv("HOME");
315
316 if (c_xdg_data_dir != NULL)
317 {
318 xdg_data_dir = c_xdg_data_dir;
319 } else if (c_user_home != NULL)
320 {
321 xdg_data_dir = (std::string)c_user_home + "/.local/share/";
322 }
323
324 if (xdg_data_dir != "")
325 {
326 plugin_prefixes.push_back(xdg_data_dir + "/wayfire/plugins");
327 }
328
329 plugin_prefixes.push_back(PLUGIN_PATH);
330
331 return plugin_prefixes;
332}
333
334std::optional<std::string> wf::get_plugin_path_for_name(
335 std::vector<std::string> plugin_paths, std::string plugin_name)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected