aboutsummaryrefslogtreecommitdiff
path: root/xchord.c
diff options
context:
space:
mode:
Diffstat (limited to 'xchord.c')
-rw-r--r--xchord.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/xchord.c b/xchord.c
index 59d3f52..ff1c755 100644
--- a/xchord.c
+++ b/xchord.c
@@ -16,6 +16,7 @@
* xchord is written by John Ankarström <john (at) ankarstrom.se>.
*/
+#include <err.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -85,7 +86,10 @@ main(int argc, char *argv[])
/* button 1 released */
if (rev->detail == 1) p1 = 0;
/* button 1 pressed + 3 released */
- if (p1 && rev->detail == 3) system("dwim");
+ if (p1 && rev->detail == 3 && vfork() == 0) {
+ execlp("dwim", "dwim", NULL);
+ err(1, "execlp");
+ }
break;
}