#!/bin/rc # use with wircrc rfork en scr=(`{cat /dev/draw/new >[2]/dev/null}) w=$scr(11) h=$scr(12) fn getwin{ if(~ $1 efnet freenode undernet) grep -e 'irc.'^$1 /dev/wsys/*/label | awk -F'/' '{print $4;}' | sed 's/[^a-zA-z0-9]//g' if not if(~ $1 *aiju* *sampuru*) grep $1 /dev/wsys/*/label | awk -F'/' '{print $4;}' | sed 's/[^a-zA-z0-9]//g' if not grep -e '#'^$1 /dev/wsys/*/label | awk -F'/' '{print $4;}' | sed 's/[^a-zA-z0-9]//g' } fn resize{ if(! ~ $#$1 0) for(i in $$1) {echo current; echo resize -r $*(2-)} >/dev/wsys/$i/wctl } switch($1){ case -w freenode=`{getwin freenode} sampuru=`{getwin sampuru} aiju=`{getwin aiju} inferno=`{getwin inferno} plan9=`{getwin plan9} 9front=`{getwin 9front} catv=`{getwin cat-v} if(~ $w 1280 && ~ $h 1024){ resize freenode 2 0 641 88 resize inferno 2 178 641 289 resize plan9 2 284 641 416 resize 9front 2 412 641 552 resize catv 2 548 641 1024 resize sampuru 2 84 641 182 resize aiju 2 412 641 552 } if not if(~ $w 1376 && ~ $h 768){ resize freenode 2 0 678 72 resize inferno 2 68 678 159 resize plan9 2 155 678 255 resize 9front 2 251 678 360 resize catv 2 356 678 768 resize sampuru 2 68 678 159 resize aiju 2 251 678 360 } if not if(~ $w 1440 && ~ $h 900){ resize freenode 2 0 720 73 resize inferno 2 69 720 173 resize plan9 2 169 720 308 resize 9front 2 304 720 448 resize catv 2 445 720 900 resize sampuru 2 69 720 173 resize aiju 2 304 720 448 } if not if(~ $w 1600 && ~ $h 1200){ resize freenode 2 0 800 78 resize inferno 2 172 800 282 resize plan9 2 278 800 463 resize 9front 2 459 800 670 resize catv 2 666 800 1200 resize sampuru 2 74 800 176 resize aiju 2 459 800 670 } if not if(~ $w 1680 && ~ $h 1050){ resize freenode 2 0 840 89 resize inferno 2 184 840 308 resize plan9 2 304 840 465 resize 9front 2 461 840 607 resize catv 2 603 840 1050 resize sampuru 2 85 840 188 resize aiju 2 461 840 607 } case -mars2 cpu -p -h mars2 -u sl -c wi case * if(test -d /n/mars2/net/tcp) bind /n/mars2/net /net user=stanleylieber wircrc & }