summaryrefslogtreecommitdiff
path: root/statusbar.c
diff options
context:
space:
mode:
authorTobias Klauser <tklauser@distanz.ch>2007-09-23 17:44:38 +0200
committerTobias Klauser <tklauser@xenon.tklauser.home>2007-09-23 17:44:38 +0200
commit44e6f61148de319a728301d15d6932122ce0fd0e (patch)
treea01217aefb1be523a18ba78ecc12543812c5caa8 /statusbar.c
parent1038919fc4f4aa1e6d58c0781d7f48409b32aa74 (diff)
Display when on ac
Diffstat (limited to 'statusbar.c')
-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;
}