wmutils

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

commit 9372688607d8d4a75f2ca75ce7a267bb603448db
parent 578567d4dfc9fa729241d9157b9f82000dee887e
Author: dcat <dcat@iotek.org>
Date:   Sat Nov  7 16:19:48 2015

switch indent and style

Diffstat:
 chwb.c  | 18 +++++++++---------
 chwso.c | 24 ++++++++++++------------
 ignw.c  |  6 +++---
 lsw.c   | 22 ++++++++++++++++------
 mapw.c  | 18 +++++++++++++-----
 wattr.c | 51 ++++++++++++++++++++++++++-------------------------
 wmp.c   | 39 ++++++++++++++++++++++-----------------
 7 files changed, 101 insertions(+), 77 deletions(-)

diff --git a/chwb.c b/chwb.c @@ -32,15 +32,15 @@ main(int argc, char **argv) usage(argv[0]); ARGBEGIN { - case 's': - width = strtoul(EARGF(usage(argv0)), NULL, 10); - break; - case 'c': - color = strtoul(EARGF(usage(argv0)), NULL, 16); - break; - default: - usage(argv0); - /* NOTREACHED */ + case 's': + width = strtoul(EARGF(usage(argv0)), NULL, 10); + break; + case 'c': + color = strtoul(EARGF(usage(argv0)), NULL, 16); + break; + default: + usage(argv0); + /* NOTREACHED */ } ARGEND init_xcb(&conn); diff --git a/chwso.c b/chwso.c @@ -37,18 +37,18 @@ main(int argc, char **argv) return 1; ARGBEGIN { - case 'r': - mode = XCB_STACK_MODE_ABOVE; - break; - case 'l': - mode = XCB_STACK_MODE_BELOW; - break; - case 'i': - mode = XCB_STACK_MODE_OPPOSITE; - break; - default: - usage(argv0); - break; + case 'r': + mode = XCB_STACK_MODE_ABOVE; + break; + case 'l': + mode = XCB_STACK_MODE_BELOW; + break; + case 'i': + mode = XCB_STACK_MODE_OPPOSITE; + break; + default: + usage(argv0); + break; } ARGEND restack(win, mode); diff --git a/ignw.c b/ignw.c @@ -37,9 +37,9 @@ main(int argc, char **argv) char *argv0; ARGBEGIN { - case 's': setflag = 1; break; - case 'r': setflag = 0; break; - default: usage(argv0); + case 's': setflag = 1; break; + case 'r': setflag = 0; break; + default: usage(argv0); } ARGEND; init_xcb(&conn); diff --git a/lsw.c b/lsw.c @@ -47,12 +47,22 @@ main(int argc, char **argv) char *argv0; 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(argv0); - } ARGEND; + 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(argv0); + /* NOTREACHED */ + } ARGEND init_xcb(&conn); get_screen(conn, &scrn); diff --git a/mapw.c b/mapw.c @@ -28,11 +28,19 @@ main(int argc, char **argv) char *argv0; ARGBEGIN { - case 'm': mapflag = MAP; break; - case 'u': mapflag = UNMAP; break; - case 't': mapflag = TOGGLE; break; - default : usage(argv0); - } ARGEND; + case 'm': + mapflag = MAP; + break; + case 'u': + mapflag = UNMAP; + break; + case 't': + mapflag = TOGGLE; + break; + default: + usage(argv0); + /* NOTREACHED */ + } ARGEND if (argc < 1 || mapflag == 0) usage(argv0); diff --git a/wattr.c b/wattr.c @@ -44,31 +44,32 @@ main(int argc, char **argv) for (i=0; i<strlen(argv[1]); i++) { switch (argv[1][i]) { - case 'i': - printf("0x%08x", w); - break; - case 'b': - printf("%d", get_attribute(w, ATTR_B)); - break; - case 'h': - printf("%d", get_attribute(w, ATTR_H)); - break; - case 'x': - printf("%d", get_attribute(w, ATTR_X)); - break; - case 'y': - printf("%d", get_attribute(w, ATTR_Y)); - break; - case 'w': - printf("%d", get_attribute(w, ATTR_W)); - break; - case 'o': - ret = is_ignored(w) ? 0 : 1; - goto end; - case 'm': - ret = is_mapped(w) ? 0 : 1; - goto end; - default: kill_xcb(&conn); usage(argv[0]); + case 'i': + printf("0x%08x", w); + break; + case 'b': + printf("%d", get_attribute(w, ATTR_B)); + break; + case 'h': + printf("%d", get_attribute(w, ATTR_H)); + break; + case 'x': + printf("%d", get_attribute(w, ATTR_X)); + break; + case 'y': + printf("%d", get_attribute(w, ATTR_Y)); + break; + case 'w': + printf("%d", get_attribute(w, ATTR_W)); + break; + case 'o': + ret = is_ignored(w) ? 0 : 1; + goto end; + case 'm': + ret = is_mapped(w) ? 0 : 1; + goto end; + default: + kill_xcb(&conn); usage(argv[0]); } /* add a space if more attribute come after */ putc(i+1 < strlen(argv[1]) ? ' ' : '\n',stdout); diff --git a/wmp.c b/wmp.c @@ -28,28 +28,33 @@ main(int argc, char **argv) uint32_t win; ARGBEGIN { - case 'a': mode = ABSOLUTE; - break; - case 'r': mode = RELATIVE; - break; - default : usage(argv0); - } ARGEND; + case 'a': + mode = ABSOLUTE; + break; + case 'r': + mode = RELATIVE; + break; + default: + usage(argv0); + /* NOTREACHED */ + } ARGEND init_xcb(&conn); get_screen(conn, &scrn); switch (argc) { - case 0: - case 1: - win = argc > 0 ? strtoul(*argv, NULL, 16) : scrn->root; - if (get_cursor(mode, win, &x, &y)) - printf("%d %d\n", x, y); - break; - case 2: - set_cursor(atoi(argv[0]), atoi(argv[1]), mode); - break; - default: - usage(argv0); + case 0: + case 1: + win = argc > 0 ? strtoul(*argv, NULL, 16) : scrn->root; + if (get_cursor(mode, win, &x, &y)) + printf("%d %d\n", x, y); + break; + case 2: + set_cursor(atoi(argv[0]), atoi(argv[1]), mode); + break; + default: + usage(argv0); + /* NOTREACHED */ } xcb_flush(conn);