aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorDon Stewart <dons@cse.unsw.edu.au>2007-06-10 11:09:59 +0200
committerDon Stewart <dons@cse.unsw.edu.au>2007-06-10 11:09:59 +0200
commit33dc139f7e1704b5241b860e0f45485b5ed3d4d5 (patch)
tree06afac8f5d6513ae929bede38997a9d6e56056d6 /scripts
parent01b0fd3eabaed0af06cec2cfd5b15523564f6afe (diff)
downloadXMonadContrib-33dc139f7e1704b5241b860e0f45485b5ed3d4d5.tar.gz
XMonadContrib-33dc139f7e1704b5241b860e0f45485b5ed3d4d5.tar.xz
XMonadContrib-33dc139f7e1704b5241b860e0f45485b5ed3d4d5.zip
use all 3 load values
darcs-hash:20070610090959-9c5c1-0f8165c921fd4f6c05cd7c569eedd90f64527d81.gz
Diffstat (limited to 'scripts')
-rw-r--r--scripts/xmonad-clock.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/scripts/xmonad-clock.c b/scripts/xmonad-clock.c
index c0bff8c..42f38bd 100644
--- a/scripts/xmonad-clock.c
+++ b/scripts/xmonad-clock.c
@@ -41,12 +41,12 @@ int main(void) {
time_t pdttime;
struct tm *pdtrealtime;
- double load;
+ double load[3];
signal(SIGPIPE, SIG_IGN);
for(;;) {
- getloadavg(&load, 1);
+ getloadavg(load, 3);
epochtime = time(NULL);
realtime = localtime(&epochtime);
@@ -58,7 +58,8 @@ int main(void) {
strftime(c, sizeof(c), TIME_FORMAT2, pdtrealtime);
unsetenv("TZ");
- fprintf(stdout, "%s | %s | %.2f | xmonad 0.3 \n", b, c, load);
+ fprintf(stdout, "%s | %s | %.2f %.2f %.2f | xmonad 0.3 \n", b, c, load[0], load[1], load[2]);
+
fflush(stdout);
sleep(REFRESH_RATE);
}