netstar pushed a commit to branch master.

http://git.enlightenment.org/apps/evisum.git/commit/?id=d9d7d3550eccb2dfe9734dd6728d16d82b5ba0a0

commit d9d7d3550eccb2dfe9734dd6728d16d82b5ba0a0
Author: Alastair Poole <nets...@gmail.com>
Date:   Tue Jun 8 09:12:18 2021 +0100

    sensor: ac adapter
---
 src/bin/system/machine/sensors.bogox | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/src/bin/system/machine/sensors.bogox 
b/src/bin/system/machine/sensors.bogox
index e561475..7daa014 100644
--- a/src/bin/system/machine/sensors.bogox
+++ b/src/bin/system/machine/sensors.bogox
@@ -534,6 +534,15 @@ system_power_state_get(power_t *power)
         power->have_ac = atoi(buf);
         free(buf);
      }
+   else
+     {
+        char *buf = file_contents("/sys/class/power_supply/ACAD/online");
+        if (buf)
+          {
+             power->have_ac = atoi(buf);
+             free(buf);
+          }
+     }
 #endif
 
    _battery_state_get(power);

-- 


Reply via email to