wmstatus: skip offline power supplies
This commit is contained in:
parent
fbc1f18393
commit
81c3c9ec3f
|
@ -1112,6 +1112,15 @@ try_power_supply (int dir, struct error **e)
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool offline = !read_number (dir, "online", &error);
|
||||||
|
if (error)
|
||||||
|
{
|
||||||
|
error_free (error);
|
||||||
|
error = NULL;
|
||||||
|
}
|
||||||
|
else if (offline)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
bool is_relevant =
|
bool is_relevant =
|
||||||
!strcmp (type, "Battery") ||
|
!strcmp (type, "Battery") ||
|
||||||
!strcmp (type, "USB") ||
|
!strcmp (type, "USB") ||
|
||||||
|
|
Loading…
Reference in New Issue