Commit 840f28167b55795ce6c3998be2c687093e480fa3
1 parent
d8824a52
Exists in
master
replaced battery icons
some of the old icons were missing in some fonts, replaced all by other code points that seem to be ok for several fonts.
Showing
1 changed file
with
17 additions
and
17 deletions
Show diff stats
battery.c
... | ... | @@ -7,18 +7,18 @@ |
7 | 7 | #include <sys/types.h> |
8 | 8 | #include <sys/sysctl.h> |
9 | 9 | |
10 | -const char *bat_icons[] = { | |
11 | - "\uf58d", /* 0% */ | |
12 | - "\uf579", | |
13 | - "\uf57a", | |
14 | - "\uf57b", | |
15 | - "\uf57c", | |
16 | - "\uf57d", /* 50% */ | |
17 | - "\uf57e", | |
18 | - "\uf57f", | |
19 | - "\uf580", | |
20 | - "\uf581", | |
21 | - "\uf578", /* 100% */ | |
10 | +const char *bat_icons1[] = { | |
11 | + "", /* 0% */ | |
12 | + "", | |
13 | + "", | |
14 | + "", | |
15 | + "", | |
16 | + "", /* 50% */ | |
17 | + "", | |
18 | + "", | |
19 | + "", | |
20 | + "", | |
21 | + "", /* 100% */ | |
22 | 22 | }; |
23 | 23 | |
24 | 24 | int main() { |
... | ... | @@ -38,19 +38,19 @@ int main() { |
38 | 38 | |
39 | 39 | switch (state) { |
40 | 40 | case 0: /* fully charged */ |
41 | - printf("\uf583 Full"); | |
41 | + printf(" Full"); | |
42 | 42 | break; |
43 | 43 | case 1: /* discharging */ |
44 | - printf("%s %d%%\n", bat_icons[life / 10], life); | |
44 | + printf("%s %d%%\n", bat_icons1[life / 10], life); | |
45 | 45 | break; |
46 | 46 | case 2: /* charging */ |
47 | - printf("\uf583 %d%%\n", life); | |
47 | + printf(" %d%%\n", life); | |
48 | 48 | break; |
49 | 49 | case 7: /* disconnected */ |
50 | - printf("\uf492"); | |
50 | + printf(""); | |
51 | 51 | break; |
52 | 52 | default: /* unknown code */ |
53 | - printf("\uf590"); | |
53 | + printf(" unknown battery code"); | |
54 | 54 | } |
55 | 55 | |
56 | 56 | return EXIT_SUCCESS; | ... | ... |