Adding config option to enable reloading style on file change

This commit is contained in:
dpayne 2024-01-21 21:02:01 -08:00
parent f7eca99496
commit 20fa578b12
1 changed files with 5 additions and 2 deletions

View File

@ -269,11 +269,14 @@ int waybar::Client::main(int argc, char *argv[]) {
auto css_file = getStyle(style_opt, appearance); auto css_file = getStyle(style_opt, appearance);
setupCss(css_file); setupCss(css_file);
}); });
m_cssReloadHelper->monitorChanges();
if (config.getConfig()["reload_style_on_change"].asBool()) {
m_cssReloadHelper->monitorChanges();
}
bindInterfaces(); bindInterfaces();
gtk_app->hold(); gtk_app->hold();
gtk_app->run(); gtk_app->run();
m_cssReloadHelper.reset(); // stop watching css file m_cssReloadHelper.reset(); // stop watching css file
bars.clear(); bars.clear();
return 0; return 0;
} }