check for group modules array in key conversion

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

View File

@ -449,7 +449,17 @@ void waybar::Bar::setupAltFormatKeyForModuleList(const char* module_list_name) {
Json::Value& modules = config[module_list_name];
for (const Json::Value& module_name : modules) {
if (module_name.isString()) {
setupAltFormatKeyForModule(module_name.asString());
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);
}
}
}
}