Slightly modified the winwatch behavior such that it can toggle the hiding and unhiding of windows. Updated the man page as well. Notes: Sat Aug 12 02:17:37 EDT 2006 rsc Though this is a common request, I don't like winwatch going around hiding windows. Maybe just bottom the window? Reference: /n/sources/patch/sorry/winwatch-hide-unhide-toggle Date: Thu Jul 20 02:45:15 CES 2006 Signed-off-by: leimy@plan9.jp Reviewed-by: rsc --- /sys/src/cmd/winwatch.c Thu Jul 20 02:43:37 2006 +++ /sys/src/cmd/winwatch.c Thu Jul 20 02:43:27 2006 @@ -225,11 +225,20 @@ return; sprint(buf, "/dev/wsys/%d/wctl", win[i].n); - if((fd = open(buf, OWRITE)) < 0) + if((fd = open(buf, ORDWR)) < 0) return; - write(fd, "unhide\n", 7); - write(fd, "top\n", 4); - write(fd, "current\n", 8); + + read(fd, buf, 127); + buf[127] = '\0'; + + if (strstr(buf, "hidden") != 0){ + write(fd, "unhide\n", 7); + write(fd, "top\n", 4); + write(fd, "current\n", 8); + } + else + write(fd, "hide\n", 5); + close(fd); } --- /sys/man/1/winwatch Thu Jul 20 02:44:26 2006 +++ /sys/man/1/winwatch Thu Jul 20 02:44:17 2006 @@ -15,7 +15,8 @@ displays the labels of all current .IR rio (4) windows, refreshing the display every five seconds. -Right clicking a window's label unhides, raises and gives focus to that window. +Right clicking a window's label will toggle the hiding or the unhiding of that window. +When a window is unhidden, it is also raised and given focus. Typing .B q or