Commit 407581b9d71dfe6d0ed8a0cda3b748c0f05e08e0
1 parent
fbcc53ca
Exists in
master
use a different set of battery icons
Showing
1 changed file
with
15 additions
and
5 deletions
Show diff stats
battery.c
| @@ -2,10 +2,25 @@ | @@ -2,10 +2,25 @@ | ||
| 2 | #include <stdlib.h> | 2 | #include <stdlib.h> |
| 3 | #include <string.h> | 3 | #include <string.h> |
| 4 | #include <sys/types.h> | 4 | #include <sys/types.h> |
| 5 | +#if defined(__FreeBSD__) | ||
| 6 | +#include <sys/sysctl.h> | ||
| 7 | +#endif | ||
| 5 | 8 | ||
| 6 | // maximum number of batteries supported | 9 | // maximum number of batteries supported |
| 7 | #define MAXBAT 2 | 10 | #define MAXBAT 2 |
| 8 | 11 | ||
| 12 | +// const char *icon[] = { FIXME: sometimes do now show up on freebsd kitty | ||
| 13 | +// "\uf58d", /* 0% */ | ||
| 14 | +// "\uf579", "\uf57a", "\uf57b", "\uf57c", "\uf57d", /* 50% */ | ||
| 15 | +// "\uf57e", "\uf57f", "\uf580", "\uf581", "\uf578", /* 100% */ | ||
| 16 | +// }; | ||
| 17 | + | ||
| 18 | +const char *icon[] = { | ||
| 19 | + "", /* 0% */ | ||
| 20 | + "", "", "", "", "", /* 50% */ | ||
| 21 | + "", "", "", "", "", /* 100% */ | ||
| 22 | +}; | ||
| 23 | + | ||
| 9 | typedef enum { | 24 | typedef enum { |
| 10 | CHARGED = 0, | 25 | CHARGED = 0, |
| 11 | DISCHARGING = 1, | 26 | DISCHARGING = 1, |
| @@ -14,11 +29,6 @@ typedef enum { | @@ -14,11 +29,6 @@ typedef enum { | ||
| 14 | UNKNOWN = -1 | 29 | UNKNOWN = -1 |
| 15 | } State; | 30 | } State; |
| 16 | 31 | ||
| 17 | -const char *icon[] = { | ||
| 18 | - "\uf58d", /* 0% */ | ||
| 19 | - "\uf579", "\uf57a", "\uf57b", "\uf57c", "\uf57d", /* 50% */ | ||
| 20 | - "\uf57e", "\uf57f", "\uf580", "\uf581", "\uf578", /* 100% */ | ||
| 21 | -}; | ||
| 22 | const char separator[] = " "; // space between battery indicators | 32 | const char separator[] = " "; // space between battery indicators |
| 23 | 33 | ||
| 24 | void battery_state(int *nbats, int bat[], State state[]) { | 34 | void battery_state(int *nbats, int bat[], State state[]) { |