Browse Source

Remove battery_power for various reasons

- Battery power cannot be easily gatherable via apm(4)
- IMHO it does not represent essential information
master
Aaron Marcher 8 years ago
parent
commit
4f5ac5d9fe
  1. 2
      README
  2. 12
      components/battery.c
  3. 1
      config.def.h
  4. 1
      slstatus.h

2
README

@ -6,7 +6,7 @@ slstatus is a suckless status monitor for window managers that use WM_NAME
Features Features
-------- --------
- Battery percentage/power/state - Battery percentage/state
- CPU usage - CPU usage
- CPU frequency - CPU frequency
- CPU iowait - CPU iowait

12
components/battery.c

@ -20,18 +20,6 @@
bprintf("%d", perc) : NULL; 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 * const char *
battery_state(const char *bat) battery_state(const char *bat)
{ {

1
config.def.h

@ -13,7 +13,6 @@ static const char unknown_str[] = "n/a";
* function description argument * function description argument
* *
* battery_perc battery percentage battery name * battery_perc battery percentage battery name
* battery_power battery power usage battery name
* battery_state battery charging state battery name * battery_state battery charging state battery name
* cpu_perc cpu usage in percent NULL * cpu_perc cpu usage in percent NULL
* cpu_iowait cpu iowait in percent NULL * cpu_iowait cpu iowait in percent NULL

1
slstatus.h

@ -2,7 +2,6 @@
/* battery */ /* battery */
const char *battery_perc(const char *); const char *battery_perc(const char *);
const char *battery_power(const char *);
const char *battery_state(const char *); const char *battery_state(const char *);
/* cpu */ /* cpu */

Loading…
Cancel
Save