From: Marco Peereboom Date: Wed, 14 Jan 2009 06:08:16 +0000 (+0000) Subject: tick tick tick; sucks because it does it in the signal handler but i am X-Git-Url: https://jasonwoof.com/gitweb/?a=commitdiff_plain;h=3574129dcc2b96800c7969bc6aa90ee92f2ded8c;p=spectrwm.git tick tick tick; sucks because it does it in the signal handler but i am not smart enough to do this with a XSendEvent --- diff --git a/scrotwm.c b/scrotwm.c index d8b6519..97446e5 100644 --- a/scrotwm.c +++ b/scrotwm.c @@ -56,6 +56,7 @@ #include #include #include +#include #include #include @@ -167,7 +168,17 @@ bar_print(void) XDrawString(display, bar_window, bar_gc, 4, bar_fs->ascent, bar_text, strlen(bar_text)); XSync(display, False); + + alarm(60); +} + +void +bar_signal(int sig) +{ + /* XXX yeah yeah byte me */ + bar_print(); } + void quit(union arg *args) { @@ -392,7 +403,7 @@ send_to_ws(union arg *args) int wsid = args->id; struct ws_win *win = ws[current_ws].focus; - DNPRINTF(SWM_D_MISC, "send_to_ws: win: %lu\n", win->id); + DNPRINTF(SWM_D_WS, "send_to_ws: win: %lu\n", win->id); XUnmapWindow(display, win->id); @@ -788,6 +799,9 @@ main(int argc, char *argv[]) height -= bar_height; /* correct screen height */ XMapWindow(display, bar_window); } + + if (signal(SIGALRM, bar_signal) == SIG_ERR) + err(1, "could not install bar_signal"); bar_print(); while (running) {