[hackers] [slstatus] Revert aac29e2 as it is nonsense || Aaron Marcher
commit 74891945d897530b30c2c29844808d63bff625b7
Author: Aaron Marcher <me_AT_drkhsh.at>
AuthorDate: Sat May 19 13:25:35 2018 +0200
Commit: Aaron Marcher <me_AT_drkhsh.at>
CommitDate: Sat May 19 13:25:35 2018 +0200
Revert aac29e2 as it is nonsense
diff --git a/components/battery.c b/components/battery.c
index b086a28..90e8590 100644
--- a/components/battery.c
+++ b/components/battery.c
_AT_@ -5,14 +5,6 @@
#include "../util.h"
-static struct {
- char *state;
- char *symbol;
-} map[] = {
- { "Charging", "+" },
- { "Discharging", "-" },
-};
-
#if defined(__linux__)
#include <limits.h>
_AT_@ -30,6 +22,13 @@ static struct {
const char *
battery_state(const char *bat)
{
+ static struct {
+ char *state;
+ char *symbol;
+ } map[] = {
+ { "Charging", "+" },
+ { "Discharging", "-" },
+ };
size_t i;
char path[PATH_MAX], state[12];
_AT_@ -122,6 +121,13 @@ static struct {
const char *
battery_state(const char *unused)
{
+ struct {
+ unsigned int state;
+ char *symbol;
+ } map[] = {
+ { APM_AC_ON, "+" },
+ { APM_AC_OFF, "-" },
+ };
struct apm_power_info apm_info;
size_t i;
Received on Sat May 19 2018 - 13:26:01 CEST
This archive was generated by hypermail 2.3.0
: Sat May 19 2018 - 13:36:24 CEST