int main(int argc, char **argv) { int listmask = 0, rootflag = 0; ARGBEGIN { case 'a': listmask |= LIST_ALL; break; case 'u': listmask |= LIST_HIDDEN; break; case 'o': listmask |= LIST_IGNORE; break; case 'r': rootflag = 1; break; default : usage(); } ARGEND; init_xcb(&conn); get_screen(conn, &scrn); if (rootflag == 1) { printf("0x%08x\n", scrn->root); return 0; } if (argc == 0) list_windows(scrn->root, listmask); while (*argv) list_windows(strtoul(*argv++, NULL, 16), listmask); kill_xcb(&conn); return 0; }
int main(int argc, char **argv) { int x, y, mode = RELATIVE; if (argc < 4) usage(argv[0]); init_xcb(&conn); get_screen(conn, &scr); if (argv[1][0] == '-' && argv[1][1] == 'a') { mode = ABSOLUTE; argv++; } x = atoi(*(++argv)); y = atoi(*(++argv)); while (*argv) move(strtoul(*argv++, NULL, 16), mode, x, y); xcb_flush(conn); kill_xcb(&conn); return 0; }
int main (int argc, char **argv) { char *argv0; ARGBEGIN { case 'l': list_events(); exit(0); case 'm': mask = strtoul(EARGF(usage(argv0)), NULL, 10); break; default: usage(argv0); } ARGEND; init_xcb(&conn); get_screen(conn, &scr); handle_events(); kill_xcb(&conn); return 0; }
int main(int argc, char *argv[]) { if (argc != 3) { usage(argv[0]); } init_xcb(&conn); set_group(argv[1], strtoul(argv[2], NULL, 16 )); kill_xcb(&conn); return 0; }
int main(int argc, char **argv) { if (argc != 3) usage(argv[0]); init_xcb(&conn); set_title(conn, strtoul(argv[2], NULL, 16), argv[1]); kill_xcb(&conn); return 0; }
int main(int argc, char **argv) { xcb_window_t win; if (argc != 2 || strncmp(argv[0], "-h", 2) == 0) usage(argv[0]); init_xcb(&conn); win = strtoul(argv[1], NULL, 16); set_focus(win); kill_xcb(&conn); return 0; }
int main(int argc, char **argv) { int c; size_t i; xcb_window_t w = 0; if (argc < 2 || (strncmp(argv[1], "-h", 2) == 0)) { argv0 = argv[0]; usage(); } init_xcb(&conn); for (c=2; argv[c]; c++) { w = strtoul(argv[c], NULL, 16); for (i=0; i<strlen(argv[1]); i++) { switch (argv[1][i]) { case 'i': printf("0x%08x", w); break; case 'b': printf("%d", getattribute(w, ATTR_B)); break; case 'h': printf("%d", getattribute(w, ATTR_H)); break; case 'x': printf("%d", getattribute(w, ATTR_X)); break; case 'y': printf("%d", getattribute(w, ATTR_Y)); break; case 'w': printf("%d", getattribute(w, ATTR_W)); break; case 'o': ignore(conn, w) ? exit(0) : exit(1); case 'm': mapped(conn, w) ? exit(0) : exit(1); default : exists(conn, w) ? exit(0) : exit(1); } /* add a space if more attribute come after */ putc(i+1 < strlen(argv[1]) ? ' ' : '\n',stdout); } } kill_xcb(&conn); return 0; }
int main(int argc, char **argv) { int x, y; if (argc < 4) usage(argv[0]); init_xcb(&conn); get_screen(conn, &scr); x = atoi(*(++argv)); y = atoi(*(++argv)); while (*argv) resize(strtoul(*argv++, NULL, 16), x, y); xcb_flush(conn); kill_xcb(&conn); return 0; }
int main (int argc, char **argv) { xcb_window_t win; if (argc != 6) usage(argv[0]); init_xcb(&conn); win = strtoul(argv[5], NULL, 16); if (!win) errx(1, "cannot get window"); teleport(win, atoi(argv[1]), atoi(argv[2]), atoi(argv[3]), atoi(argv[4])); xcb_flush(conn); kill_xcb(&conn); return 0; }
int main(int argc, char **argv) { int setflag = 0; char *argv0; ARGBEGIN { case 's': setflag = 1; break; case 'r': setflag = 0; break; default: usage(argv0); } ARGEND; init_xcb(&conn); while (*argv) set_override(strtoul(*argv++, NULL, 16), setflag); xcb_flush(conn); kill_xcb(&conn); return 0; }