Per host checks
This commit is contained in:
@@ -183,6 +183,7 @@ src_files = files(
|
|||||||
'src/util/sanitize_str.cpp',
|
'src/util/sanitize_str.cpp',
|
||||||
'src/util/hosts_check.cpp',
|
'src/util/hosts_check.cpp',
|
||||||
'src/util/rewrite_string.cpp',
|
'src/util/rewrite_string.cpp',
|
||||||
|
'src/util/hosts_check.cpp',
|
||||||
'src/util/gtk_icon.cpp',
|
'src/util/gtk_icon.cpp',
|
||||||
'src/util/icon_loader.cpp',
|
'src/util/icon_loader.cpp',
|
||||||
'src/util/regex_collection.cpp',
|
'src/util/regex_collection.cpp',
|
||||||
|
|||||||
+4
-1
@@ -9,6 +9,7 @@
|
|||||||
#include "factory.hpp"
|
#include "factory.hpp"
|
||||||
#include "group.hpp"
|
#include "group.hpp"
|
||||||
#include "util/enum.hpp"
|
#include "util/enum.hpp"
|
||||||
|
#include "util/hosts_check.hpp"
|
||||||
#include "util/kill_signal.hpp"
|
#include "util/kill_signal.hpp"
|
||||||
#include "util/hosts_check.hpp"
|
#include "util/hosts_check.hpp"
|
||||||
|
|
||||||
@@ -532,6 +533,7 @@ void waybar::Bar::getModules(const Factory& factory, const std::string& pos,
|
|||||||
for (const auto& name : module_list) {
|
for (const auto& name : module_list) {
|
||||||
try {
|
try {
|
||||||
auto ref = name.asString();
|
auto ref = name.asString();
|
||||||
|
|
||||||
const Json::Value* module_config = nullptr;
|
const Json::Value* module_config = nullptr;
|
||||||
if (config.isMember(ref)) {
|
if (config.isMember(ref)) {
|
||||||
module_config = &config[ref];
|
module_config = &config[ref];
|
||||||
@@ -544,7 +546,8 @@ void waybar::Bar::getModules(const Factory& factory, const std::string& pos,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (module_config && !waybar::util::valid_host(*module_config)) continue;
|
if ((module_config != nullptr) && !waybar::util::valid_host(*module_config)) continue;
|
||||||
|
|
||||||
AModule* module;
|
AModule* module;
|
||||||
|
|
||||||
if (ref.compare(0, 6, "group/") == 0 && ref.size() > 6) {
|
if (ref.compare(0, 6, "group/") == 0 && ref.size() > 6) {
|
||||||
|
|||||||
Reference in New Issue
Block a user