fix(battery): gate Full-as-Plugged behind full-at-plugged option, drop debug output

Reporting a full battery on AC as 'Plugged' is now opt-in via the
'full-at-plugged' config option (default false), so existing format-full /
tooltip-format-full setups keep working. Also documents the option.
This commit is contained in:
Alex
2026-07-03 21:40:41 +02:00
parent eff483de1f
commit 31a3d7e1bb
2 changed files with 6 additions and 1 deletions
+5
View File
@@ -27,6 +27,11 @@ The *battery* module displays the current capacity and state (eg. charging) of y
default: false ++
Option to use the battery design capacity instead of its current maximal capacity.
*full-at-plugged*: ++
typeof: bool ++
default: false ++
When enabled, a battery that is *Full* while the adapter is online is reported with the *Plugged* status instead of *Full* (so you can style/format it separately). Disabled by default to preserve the existing *Full* behaviour.
*interval*: ++
typeof: integer ++
default: 60 ++
+1 -1
View File
@@ -706,7 +706,7 @@ auto waybar::modules::Battery::update() -> void {
if (!adapter_.empty()) {
std::ifstream(adapter_ / "online") >> adapter_online;
}
if (status == "Full" && adapter_online) {
if (config_["full-at-plugged"].asBool() && status == "Full" && adapter_online) {
status = "Plugged";
}
auto status_pretty = status;