fix: reload style

This commit is contained in:
Alex 2024-01-31 22:57:20 +01:00
parent fb6658e8fd
commit 6dcae2cade
1 changed files with 10 additions and 1 deletions

View File

@ -270,9 +270,18 @@ int waybar::Client::main(int argc, char *argv[]) {
setupCss(css_file); setupCss(css_file);
}); });
if (config.getConfig()["reload_style_on_change"].asBool()) { auto config = config.getConfig();
if (config.isObject() && config["reload_style_on_change"].asBool()) {
m_cssReloadHelper->monitorChanges(); m_cssReloadHelper->monitorChanges();
} else if (config.isArray()) {
for (const auto &conf : config) {
if (conf["reload_style_on_change"].asBool()) {
m_cssReloadHelper->monitorChanges();
break;
}
}
} }
bindInterfaces(); bindInterfaces();
gtk_app->hold(); gtk_app->hold();
gtk_app->run(); gtk_app->run();