Merge pull request #3068 from ordy/master

(Fix) Alt format on group modules
master
Alexis Rouillard 2024-03-25 19:01:48 +01:00 committed by GitHub
commit e8627e140c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
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]; Json::Value& modules = config[module_list_name];
for (const Json::Value& module_name : modules) { for (const Json::Value& module_name : modules) {
if (module_name.isString()) { 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);
}
} }
} }
} }