check for group modules array in key conversion

This commit is contained in:
Sano 2024-03-23 18:39:22 +01:00
parent cc084f5f86
commit 70ef406d6b
1 changed files with 11 additions and 1 deletions

View File

@ -448,10 +448,20 @@ void waybar::Bar::setupAltFormatKeyForModuleList(const char* module_list_name) {
if (config.isMember(module_list_name)) {
Json::Value& modules = config[module_list_name];
for (const Json::Value& module_name : modules) {
if (module_name.isString()) {
auto ref = module_name.asString();
if (ref.compare(0, 6, "group/") == 0 && ref.size() > 6) {
Json::Value& group_modules = config[ref]["modules"];
for (const Json::Value& module_name : group_modules) {
if (module_name.isString()) {
setupAltFormatKeyForModule(module_name.asString());
}
}
} else {
setupAltFormatKeyForModule(ref);
}
}
}
}
}