From 6477e539d0da791c7248f7d2a06bc8a8aafd023e Mon Sep 17 00:00:00 2001 From: Eric L Date: Fri, 4 Nov 2022 19:38:05 +0000 Subject: [PATCH] Battery: Plugged status has higher priority --- src/modules/battery.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/modules/battery.cpp b/src/modules/battery.cpp index fdd81b5..5576054 100644 --- a/src/modules/battery.cpp +++ b/src/modules/battery.cpp @@ -470,7 +470,9 @@ const std::tuple waybar::modules::Battery::g } } - if (!adapter_.empty() && status == "Discharging") { + // Give `Plugged` higher priority over `Not charging`. + // So in a setting where TLP is used, `Plugged` is shown when the threshold is reached + if (!adapter_.empty() && (status == "Discharging" || status == "Not charging")) { bool online; std::string current_status; std::ifstream(adapter_ / "online") >> online;