diff options
author | Přemysl Eric Janouch <p@janouch.name> | 2022-02-01 22:37:34 +0100 |
---|---|---|
committer | Přemysl Eric Janouch <p@janouch.name> | 2022-02-01 22:37:34 +0100 |
commit | 81c3c9ec3ff12febbb14ff6d806b2eae4c304980 (patch) | |
tree | cc666e18f52dd87f0d364b3b8310c3ca2076036f | |
parent | fbc1f183934980e5477926baae034274b8277409 (diff) | |
download | desktop-tools-81c3c9ec3ff12febbb14ff6d806b2eae4c304980.tar.gz desktop-tools-81c3c9ec3ff12febbb14ff6d806b2eae4c304980.tar.xz desktop-tools-81c3c9ec3ff12febbb14ff6d806b2eae4c304980.zip |
wmstatus: skip offline power supplies
-rw-r--r-- | wmstatus.c | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -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") || |