mirror of
https://github.com/rad4day/Waybar.git
synced 2025-07-18 00:42:46 +02:00
Adding css reloader
This commit is contained in:
@@ -262,15 +262,18 @@ int waybar::Client::main(int argc, char *argv[]) {
|
||||
if (!portal) {
|
||||
portal = std::make_unique<waybar::Portal>();
|
||||
}
|
||||
auto css_file = getStyle(style_opt);
|
||||
setupCss(css_file);
|
||||
m_cssFile = getStyle(style_opt);
|
||||
setupCss(m_cssFile);
|
||||
m_cssReloadHelper = std::make_unique<CssReloadHelper>(m_cssFile, [&]() { setupCss(m_cssFile); });
|
||||
portal->signal_appearance_changed().connect([&](waybar::Appearance appearance) {
|
||||
auto css_file = getStyle(style_opt, appearance);
|
||||
setupCss(css_file);
|
||||
});
|
||||
m_cssReloadHelper->monitorChanges();
|
||||
bindInterfaces();
|
||||
gtk_app->hold();
|
||||
gtk_app->run();
|
||||
m_cssReloadHelper.reset(); // stop watching css file
|
||||
bars.clear();
|
||||
return 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user