wmstatus: skip offline power supplies

This commit is contained in:
Přemysl Eric Janouch 2022-02-01 22:37:34 +01:00
parent fbc1f18393
commit 81c3c9ec3f
Signed by: p
GPG Key ID: A0420B94F92B9493

View File

@ -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") ||