From 81c3c9ec3ff12febbb14ff6d806b2eae4c304980 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C5=99emysl=20Eric=20Janouch?= Date: Tue, 1 Feb 2022 22:37:34 +0100 Subject: wmstatus: skip offline power supplies --- wmstatus.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/wmstatus.c b/wmstatus.c index a35ebc6..29cfa0f 100644 --- a/wmstatus.c +++ b/wmstatus.c @@ -1112,6 +1112,15 @@ try_power_supply (int dir, struct error **e) return NULL; } + bool offline = !read_number (dir, "online", &error); + if (error) + { + error_free (error); + error = NULL; + } + else if (offline) + return NULL; + bool is_relevant = !strcmp (type, "Battery") || !strcmp (type, "USB") || -- cgit v1.2.3