Xinqi Bao's Git
projects
/
slstatus.git
/ diff
summary
|
log
|
commit
|
diff
|
tree
raw
|
patch
|
inline
| side by side (parent:
06d4447
)
Revert aac29e2 as it is nonsense
author
Aaron Marcher <
[email protected]
>
Sat, 19 May 2018 11:25:35 +0000
(13:25 +0200)
committer
Aaron Marcher <
[email protected]
>
Sat, 19 May 2018 11:25:35 +0000
(13:25 +0200)
components/battery.c
diff
|
blob
|
history
diff --git
a/components/battery.c
b/components/battery.c
index
b086a28
..
90e8590
100644
(file)
--- a/
components/battery.c
+++ b/
components/battery.c
@@
-5,14
+5,6
@@
#include "../util.h"
#include "../util.h"
-static struct {
- char *state;
- char *symbol;
-} map[] = {
- { "Charging", "+" },
- { "Discharging", "-" },
-};
-
#if defined(__linux__)
#include <limits.h>
#if defined(__linux__)
#include <limits.h>
@@
-30,6
+22,13
@@
static struct {
const char *
battery_state(const char *bat)
{
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];
size_t i;
char path[PATH_MAX], state[12];
@@
-122,6
+121,13
@@
static struct {
const char *
battery_state(const char *unused)
{
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;
struct apm_power_info apm_info;
size_t i;