wmutils

X windows manipulation utilities
git clone git://z3bra.org/wmutils
Log | Files | Refs | LICENSE

commit 4932423d13b593ded30807379a0f5972de727e59
parent cfa23bece6d674342e125da3d1cd1423acb33b74
Author: z3bra <willy@mailoo.org>
Date:   Thu Nov 27 23:03:29 2014

new tool: killw

Diffstat:
 killw.c | 41 +++++++++++++++++++++++++++++++++++++++++
 1 file changed, 41 insertions(+), 0 deletions(-)

diff --git a/killw.c b/killw.c @@ -0,0 +1,41 @@ +#include <stdio.h> +#include <stdlib.h> +#include <err.h> +#include <xcb/xcb.h> + +static xcb_connection_t *conn; + +static void usage(void); +static void xcbinit(void); +static void cleanup(void); + +static void +xcbinit(void) +{ + conn = xcb_connect(NULL, NULL); + if (xcb_connection_has_error(conn)) + errx(1, "xcb_connect"); +} + +static void +cleanup(void) +{ + if (conn != NULL) + xcb_disconnect(conn); +} + +int +main(int argc, char **argv) +{ + int i; + + atexit(cleanup); + xcbinit(); + + for (i=1; i<argc; i++) + xcb_kill_client(conn, strtoul(argv[i], NULL, 16)); + + xcb_flush(conn); + + return 0; +}