diff --git a/src/modules/battery.cpp b/src/modules/battery.cpp index 70892fa8..3b1ebb8b 100644 --- a/src/modules/battery.cpp +++ b/src/modules/battery.cpp @@ -74,6 +74,8 @@ std::tuple waybar::modules::Battery::getInfos() std::ifstream(bat / "status") >> _status; if (_status != "Unknown") { status = _status; + }else if (config_["full-is-unknown"].isString() && config_["full-is-unknown"] == "true") { + status = "Full"; //Some notebooks (e.g. Thinkpad T430s) report a full battery as "Unknown". } total += capacity; } @@ -125,8 +127,13 @@ auto waybar::modules::Battery::update() -> void } } else { label_.get_style_context()->remove_class("charging"); - if (status == "Full" && config_["format-full"].isString()) { - format = config_["format-full"].asString(); + if (status == "Full"){ + label_.get_style_context()->add_class("full"); + if (config_["format-full"].isString()) { + format = config_["format-full"].asString(); + } + }else{ + label_.get_style_context()->remove_class("full"); } } auto state = getState(capacity, charging);