fix(battery): check for battries :(

This commit is contained in:
Alexis
2018-08-10 18:02:12 +02:00
parent 4d3879f26f
commit d728de2dd7
2 changed files with 9 additions and 4 deletions

View File

@ -14,6 +14,11 @@ waybar::modules::Battery::Battery(Json::Value config)
std::cerr << e.what() << std::endl;
}
if (!_batteries.size()) {
std::cerr << "No battries." << std::endl;
return;
}
_label.get_style_context()->add_class("battery");
_thread = [this] {