Add battery
This commit is contained in:
parent
1145ff4c4e
commit
cb203250c5
@ -182,6 +182,7 @@ main(void)
|
|||||||
char *avgs;
|
char *avgs;
|
||||||
char *tmbln;
|
char *tmbln;
|
||||||
char *t0, *t1;
|
char *t0, *t1;
|
||||||
|
char *bat;
|
||||||
|
|
||||||
if (!(dpy = XOpenDisplay(NULL))) {
|
if (!(dpy = XOpenDisplay(NULL))) {
|
||||||
fprintf(stderr, "dwmstatus: cannot open display.\n");
|
fprintf(stderr, "dwmstatus: cannot open display.\n");
|
||||||
@ -193,13 +194,15 @@ main(void)
|
|||||||
tmbln = mktimes("%a %d %b %H:%M %Z %Y", tzberlin);
|
tmbln = mktimes("%a %d %b %H:%M %Z %Y", tzberlin);
|
||||||
t0 = gettemperature("/sys/class//hwmon/hwmon0", "temp1_input");
|
t0 = gettemperature("/sys/class//hwmon/hwmon0", "temp1_input");
|
||||||
t1 = gettemperature("/sys/class//hwmon/hwmon2", "temp1_input");
|
t1 = gettemperature("/sys/class//hwmon/hwmon2", "temp1_input");
|
||||||
|
bat = getbattery("/sys/class/power_supply/BAT0");
|
||||||
|
|
||||||
status = smprintf("Temp: %s, %s | Load: %s | %s %s",
|
status = smprintf("Bat: %s | Temp: %s, %s | Load: %s | %s %s",
|
||||||
t0, t1, avgs, tmbln);
|
bat, t0, t1, avgs, tmbln);
|
||||||
setstatus(status);
|
setstatus(status);
|
||||||
|
|
||||||
free(t0);
|
free(t0);
|
||||||
free(t1);
|
free(t1);
|
||||||
|
free(bat);
|
||||||
free(avgs);
|
free(avgs);
|
||||||
free(tmbln);
|
free(tmbln);
|
||||||
free(status);
|
free(status);
|
||||||
|
Loading…
Reference in New Issue
Block a user