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

Method parseConfig

src/modules/hyprland/workspaces.cpp:623–654  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

621}
622
623auto Workspaces::parseConfig(const Json::Value& config) -> void {
624 const auto& configFormat = config["format"];
625 m_formatBefore = configFormat.isString() ? configFormat.asString() : "{name}";
626 m_withIcon = m_formatBefore.find("{icon}") != std::string::npos;
627 auto withWindows = m_formatBefore.find("{windows}") != std::string::npos;
628
629 if (m_withIcon && m_iconsMap.empty()) {
630 populateIconsMap(config["format-icons"]);
631 }
632
633 populateBoolConfig(config, "all-outputs", m_allOutputs);
634 populateBoolConfig(config, "show-special", m_showSpecial);
635 populateBoolConfig(config, "special-visible-only", m_specialVisibleOnly);
636 populateBoolConfig(config, "persistent-only", m_persistentOnly);
637 populateBoolConfig(config, "active-only", m_activeOnly);
638 populateBoolConfig(config, "move-to-monitor", m_moveToMonitor);
639
640 m_persistentWorkspaceConfig = config.get("persistent-workspaces", Json::Value());
641 populateSortByConfig(config);
642 populateIgnoreWorkspacesConfig(config);
643 populateFormatWindowSeparatorConfig(config);
644 populateWindowRewriteConfig(config);
645
646 if (withWindows) {
647 populateWorkspaceTaskbarConfig(config);
648 }
649 if (m_enableTaskbar) {
650 auto parts = split(m_formatBefore, "{windows}", 1);
651 m_formatBefore = parts[0];
652 m_formatAfter = parts.size() > 1 ? parts[1] : "";
653 }
654}
655
656auto Workspaces::populateIconsMap(const Json::Value& formatIcons) -> void {
657 for (const auto& name : formatIcons.getMemberNames()) {

Callers

nothing calls this directly

Calls 3

splitFunction · 0.85
emptyMethod · 0.80
getMethod · 0.80

Tested by

no test coverage detected