A small patch to winwatch, to exclude certain windownames from being displayed. So winwatch -e '^(winwatch)' does not display winwatch itself. The code was done by Nils O. SelÄsdal and the manpage by Christoph Lohmann <20h@r-36.net>. Reference: /n/sources/patch/applied/winwatch-exclude Date: Sun Apr 10 16:05:35 CES 2005 --- /sys/src/cmd/winwatch.c Sun Apr 10 16:05:01 2005 +++ /sys/src/cmd/winwatch.c Sun Apr 10 16:04:58 2005 @@ -2,6 +2,7 @@ #include #include #include +#include typedef struct Win Win; struct Win { @@ -11,6 +12,9 @@ Rectangle r; }; + + +Reprog *exclude = nil; Win *win; int nwin; int mwin; @@ -60,6 +64,7 @@ return t; } + void refreshwin(void) { @@ -83,6 +88,9 @@ if(m < 0) continue; label[m] = '\0'; + if(exclude != nil && regexec(exclude,label,nil,0)) + continue; + if(nw < nwin && win[nw].n == n && strcmp(win[nw].label, label)==0){ nw++; continue; @@ -92,6 +100,7 @@ free(win[nw].label); win[nw].label = nil; } + if(nw >= mwin){ mwin += 8; win = erealloc(win, mwin*sizeof(win[0])); @@ -227,7 +236,7 @@ void usage(void) { - fprint(2, "usage: winwatch [-f font]\n"); + fprint(2, "usage: winwatch [-e exclude] [-f font]\n"); exits("usage"); } @@ -242,6 +251,11 @@ ARGBEGIN{ case 'f': fontname = EARGF(usage()); + break; + case 'e': + exclude = regcomp(EARGF(usage())); + if(exclude == nil) + sysfatal("Bad regexp"); break; default: usage(); --- /sys/man/1/winwatch Sun Apr 10 16:05:18 2005 +++ /sys/man/1/winwatch Sun Apr 10 16:05:15 2005 @@ -4,6 +4,9 @@ .SH SYNOPSIS .B winwatch [ +.B -e +.I exclude +] [ .B -f .I font ] @@ -19,6 +22,14 @@ DEL quits .IR winwatch . +.PP +The -e flag specifies a regular expression to exclude certain windows. +.SH EXAMPLE +Excluding winwatch, stats and faces from being showed. +.IP +.EX +% winwatch -e '^(winwatch|stats|faces)' +.EE .SH FILES .B /dev/wsys/*/label .SH SOURCE @@ -26,4 +37,5 @@ .SH SEE ALSO .IR rio (1), .IR window (1), -.IR rio (4). +.IR rio (4), +.IR regexp(6).