From 972535cab9614241cb6842e3c09f67f27e22352c Mon Sep 17 00:00:00 2001 From: Yannik Schmidt Date: Tue, 7 Oct 2025 13:06:40 +0200 Subject: [PATCH] fix: fully charged not showing correctly on old batteries --- herbstluftwm/hl_status_deamon.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/herbstluftwm/hl_status_deamon.py b/herbstluftwm/hl_status_deamon.py index bb43d8a..30bfdc0 100755 --- a/herbstluftwm/hl_status_deamon.py +++ b/herbstluftwm/hl_status_deamon.py @@ -101,10 +101,10 @@ def battery(): plain = int(bat.split('%')[0][-3:].rstrip('%').lstrip(',')) ## imediatelly return if full and on supply ## + if bat.startswith("Full") or bat.startswith('Unknown') or plain > 98: + return hl_utils.color_panel("On Supply and fully charged", GREEN) if "not charging" in bat.lower(): return hl_utils.color_panel(bat, GREEN) - if bat.startswith("Full") or bat.startswith('Unknown') or "100%" in bat or "99%" in bat: - return hl_utils.color_panel("On Supply and fully charged", GREEN) ## calculate average time remaining ## sph = 60*60