#include #include #include #include #include #include int main(int argc, char **argv) { if(argc == 2 && fork() == 0) { prctl(PR_SET_PDEATHSIG, SIGHUP); char *cmd[] = {"/bin/bash", "-c", argv[1], NULL}; execvp(cmd[0], cmd); } xcb_connection_t *c = xcb_connect(NULL, NULL); if(xcb_connection_has_error(c)) return 1; bool running = true; while(running) { xcb_generic_event_t *e = xcb_wait_for_event(c); free(e); if(xcb_connection_has_error(c)) running = false; } xcb_disconnect(c); return 0; }