From 0eb09810dc8664482b2131b7618de5b247720e2b Mon Sep 17 00:00:00 2001 From: LemonBoy Date: Thu, 13 Mar 2014 23:33:52 +0000 Subject: [PATCH] Get rid of the synchronous system call by piping the command to stdout as suggested in #46 --- bar.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bar.c b/bar.c index b9481d0..a2ec3f0 100644 --- a/bar.c +++ b/bar.c @@ -1037,8 +1037,8 @@ main (int argc, char **argv) press_ev = (xcb_button_press_event_t *)ev; /* Respond to left click */ if (press_ev->detail == XCB_BUTTON_INDEX_1) { - area_t *a = area_get(press_ev->event, press_ev->event_x); - if (a) system(a->cmd); + area_t *area = area_get(press_ev->event, press_ev->event_x); + if (area) { write(STDOUT_FILENO, area->cmd, strlen(area->cmd)); write(STDOUT_FILENO, "\n", 1); } } break; }