mirror of
https://github.com/rad4day/Waybar.git
synced 2023-12-21 10:22:59 +01:00
add check that all batteries from type battery
This commit is contained in:
parent
b23ba00cff
commit
401ea05dd8
@ -53,8 +53,13 @@ void waybar::modules::Battery::getBatteries() {
|
||||
auto bat_defined = config_["bat"].isString();
|
||||
if (((bat_defined && dir_name == config_["bat"].asString()) || !bat_defined) &&
|
||||
fs::exists(node.path() / "capacity") && fs::exists(node.path() / "uevent") &&
|
||||
fs::exists(node.path() / "status")) {
|
||||
batteries_.push_back(node.path());
|
||||
fs::exists(node.path() / "status") && fs::exists(node.path() / "type")) {
|
||||
std::string type;
|
||||
std::ifstream(node.path() / "type") >> type;
|
||||
|
||||
if (!type.compare("Battery")){
|
||||
batteries_.push_back(node.path());
|
||||
}
|
||||
}
|
||||
auto adap_defined = config_["adapter"].isString();
|
||||
if (((adap_defined && dir_name == config_["adapter"].asString()) || !adap_defined) &&
|
||||
|
Loading…
Reference in New Issue
Block a user