From 6dcae2cadeccc74e8c575be6caed8cde29682f1e Mon Sep 17 00:00:00 2001 From: Alex Date: Wed, 31 Jan 2024 22:57:20 +0100 Subject: [PATCH 1/2] fix: reload style --- src/client.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/client.cpp b/src/client.cpp index bd0ee41a1..e32f8140c 100644 --- a/src/client.cpp +++ b/src/client.cpp @@ -270,9 +270,18 @@ int waybar::Client::main(int argc, char *argv[]) { 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(); + } else if (config.isArray()) { + for (const auto &conf : config) { + if (conf["reload_style_on_change"].asBool()) { + m_cssReloadHelper->monitorChanges(); + break; + } + } } + bindInterfaces(); gtk_app->hold(); gtk_app->run(); From f1016322b988967f059304b1beee69860baf8b12 Mon Sep 17 00:00:00 2001 From: Alex Date: Wed, 31 Jan 2024 22:59:09 +0100 Subject: [PATCH 2/2] fix: tpyo --- src/client.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/client.cpp b/src/client.cpp index e32f8140c..73c06fb87 100644 --- a/src/client.cpp +++ b/src/client.cpp @@ -270,11 +270,11 @@ int waybar::Client::main(int argc, char *argv[]) { setupCss(css_file); }); - auto config = config.getConfig(); - if (config.isObject() && config["reload_style_on_change"].asBool()) { + auto m_config = config.getConfig(); + if (m_config.isObject() && m_config["reload_style_on_change"].asBool()) { m_cssReloadHelper->monitorChanges(); - } else if (config.isArray()) { - for (const auto &conf : config) { + } else if (m_config.isArray()) { + for (const auto &conf : m_config) { if (conf["reload_style_on_change"].asBool()) { m_cssReloadHelper->monitorChanges(); break;