summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--statusbar.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/statusbar.c b/statusbar.c
index e055100..74c3713 100644
--- a/statusbar.c
+++ b/statusbar.c
@@ -32,6 +32,8 @@ int main(int argc, char **argv)
return -1;
if (!(init_acpi_batt(&g) == SUCCESS))
return -1;
+ if (!(init_acpi_acadapt(&g) == SUCCESS))
+ return -1;
if (!(init_acpi_thermal(&g) == SUCCESS))
return -1;
@@ -45,7 +47,8 @@ int main(int argc, char **argv)
/* 2) Battery percentage (only the first battery matters for now) */
read_acpi_batt(0);
if (batteries[0].present)
- printf("%d%% | ", batteries[0].percentage);
+ printf("%d%% %s | ", batteries[0].percentage,
+ g.adapt.ac_state == P_AC ? "(ac)" : "");
/* 3) Temperature */
printf("%d C | ", g.temperature);
@@ -85,7 +88,10 @@ int main(int argc, char **argv)
up = info.uptime;
uph = up / HOUR;
upm = (up % HOUR) / MINUTE;
- printf("%lu:%.02lu | %.02f %.02f %.02f\n", uph, upm, info.loads[0] / LOADS_SCALE, info.loads[1] / LOADS_SCALE, info.loads[2] / LOADS_SCALE);
+ printf("%lu:%.02lu | %.02f %.02f %.02f\n", uph, upm,
+ info.loads[0] / LOADS_SCALE,
+ info.loads[1] / LOADS_SCALE,
+ info.loads[2] / LOADS_SCALE);
return 0;
}