wmutils

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

commit 62f0fe421dd4fd37a767309415fc7ea2d0556287
parent 74fcdf967195d1aa951d80f9938e33328624f886
Author: z3bra <willy@mailoo.org>
Date:   Fri Jan  9 18:50:35 2015

Fixed wattr usage and manpage

Diffstat:
 man/wattr.1 |  8 +++++++-
 wattr.c     | 40 +++++++++++++++++++++++++---------------
 2 files changed, 32 insertions(+), 16 deletions(-)

diff --git a/man/wattr.1 b/man/wattr.1 @@ -7,7 +7,7 @@ .Nd get window attributes .Sh SYNOPSIS .Nm wattr -.Op Cm bmhwxy +.Op Cm bmiowhxy .Ar wid .Sh DESCRIPTION .Nm @@ -26,6 +26,9 @@ will return 0 if .Ar wid exists, and 1 otherwise. .Bl -tag -width Ds +.It Cm i +Print +.Ar wid .It Cm b Print .Ar wid Ns \(cqs border width. @@ -50,6 +53,9 @@ Print Print .Ar wid Ns \(cqs height. +.It Cm o +.Nm +returns 0 if the override_redirect attribute is set on the window. .It Cm m .Nm returns 0 if diff --git a/wattr.c b/wattr.c @@ -27,7 +27,7 @@ enum { static void usage(char *name) { - fprintf(stderr, "usage: %s [-h] [bmiwhxy] <wid>\n", name); + fprintf(stderr, "usage: %s [-h] [bmiowhxy] <wid>\n", name); exit(1); } @@ -79,20 +79,30 @@ 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 = ignore(conn, w) ? 0 : 1; goto end; - case 'm': ret = mapped(conn, w) ? 0 : 1; goto end; + 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 = ignore(conn, w) ? 0 : 1; + goto end; + case 'm': + ret = mapped(conn, w) ? 0 : 1; + goto end; default: kill_xcb(&conn); usage(argv[0]); } /* add a space if more attribute come after */