Remove battery_power for various reasons
authorAaron Marcher <me@drkhsh.at>
Tue, 1 May 2018 19:01:25 +0000 (21:01 +0200)
committerAaron Marcher <me@drkhsh.at>
Tue, 1 May 2018 19:01:25 +0000 (21:01 +0200)
- Battery power cannot be easily gatherable via apm(4)
- IMHO it does not represent essential information

README
components/battery.c
config.def.h
slstatus.h

diff --git a/README b/README
index 78dc7ab1ba3a531ae4915a92b4205baa7c93c16f..30cacd484c3493a39cec38b455f1e4df9116aea7 100644 (file)
--- a/README
+++ b/README
@@ -6,7 +6,7 @@ slstatus is a suckless status monitor for window managers that use WM_NAME
 
 Features
 --------
-- Battery percentage/power/state
+- Battery percentage/state
 - CPU usage
 - CPU frequency
 - CPU iowait
index 327d5765c66991408f2e668e05934894a22702ed..86ea2a1e5e434793f5f4b2c335ad45f6032793ed 100644 (file)
                       bprintf("%d", perc) : NULL;
        }
 
-       const char *
-       battery_power(const char *bat)
-       {
-               int watts;
-               char path[PATH_MAX];
-
-               snprintf(path, sizeof(path), "%s%s%s", "/sys/class/power_supply/",
-                        bat, "/power_now");
-               return (pscanf(path, "%i", &watts) == 1) ?
-                      bprintf("%d", (watts + 500000) / 1000000) : NULL;
-       }
-
        const char *
        battery_state(const char *bat)
        {
index 1e3be56a08a53309fe1bcfb0fca3e929eb85aa67..d1cb995838351b0ba1fcd28ae0964469fb5d7071 100644 (file)
@@ -13,7 +13,6 @@ static const char unknown_str[] = "n/a";
  * function             description                     argument
  *
  * battery_perc         battery percentage              battery name
- * battery_power        battery power usage             battery name
  * battery_state        battery charging state          battery name
  * cpu_perc             cpu usage in percent            NULL
  * cpu_iowait           cpu iowait in percent           NULL
index 3024a4d2c868a49910f138c13f1fc2ba385237f9..a1060701d054fcc28ed665bd0302bbf7a3315e72 100644 (file)
@@ -2,7 +2,6 @@
 
 /* battery */
 const char *battery_perc(const char *);
-const char *battery_power(const char *);
 const char *battery_state(const char *);
 
 /* cpu */