Plan 9 from Bell Labs’s /usr/web/sources/contrib/sl/rc/verso

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


#!/bin/rc
# setup left half of the screen
rfork e
scr=(`{cat /dev/draw/new >[2]/dev/null})
w=$scr(11)
h=$scr(12)
if(~ $w 640 && ~ $h 480){
	# nothing to see here
}
if not if(~ $w 1024 && ~ $h 768){
	switch($1){
	case -2
		window -scroll -r 2 0 616 384 'label ltop; rc'
		window -scroll -r 2 380 616 768 'label lbottom; rc'
	case -i
		window -scroll -r 2 0 616 142 'label freenode; cpu -h mars2.inri.net -u sl -c ''shirc'''
		window -scroll -r 2 136 616 280 'label plan9; cpu -h mars2.inri.net -u sl -c ''shirc -b 50 -t ''''#plan9'''''''
		window -scroll -r 2 276 616 466 'label 9front; cpu -h mars2.inri.net -u sl -c ''shirc -b 50 -t ''''#9front'''''''
		window -scroll -r 2 462 616 768 'label cat-v; cpu -h mars2.inri.net -u sl -c ''shirc -b 50 -t ''''#cat-v'''''''
	case *
		window -scroll -r 2 0 616 768 'label left; rc'
	}
}
if not if(~ $w 1280 && ~ $h 800){
	switch($1){
	case -2
		window -scroll -r 2 0 640 510 'label ltop; rc'
		window -scroll -r 2 510 640 $v 'label lbottom; rc'
	case -i
		window -scroll -r 2 0 640 100 'label freenode; cpu -h mars2.inri.net -u sl -c ''shirc'''
		window -scroll -r 2 96 640 205 'label plan9; cpu -h mars2.inri.net -u sl -c ''shirc -b 50 -t ''''#plan9'''''''
		window -scroll -r 2 201 640 360 'label 9front; cpu -h mars2.inri.net -u sl -c ''shirc -b 50 -t ''''#9front'''''''
		window -scroll -r 2 356 640 800 'label cat-v; cpu -h mars2.inri.net -u sl -c ''shirc -b 50 -t ''''#cat-v'''''''
	case *
		window -scroll -r 2 0 640 800 'label left; rc'
	}
}
if not if(~ $w 1280 && ~ $h 1024){
	switch($1){
	case -2
		window -scroll -r 2 0 640 510 'label ltop; rc'
		window -scroll -r 2 510 640 1024 'label lbottom; rc'
	case -i
		window -scroll -r 2 0 641 88 'label freenode; cpu -h mars2.inri.net -u sl -c ''shirc'''
		window -scroll -r 2 84 642 182 'label privmsg; cpu -h mars2.inri.net -u sl -c ''shirc -b 50 -t sampuru'''
		window -scroll -r 2 178 641 289 'label inferno; cpu -h mars2.inri.net -u sl -c ''shirc -b 50 -t ''''#inferno'''''''
		window -scroll -r  2 284 641 416 'label plan9; cpu -h mars2.inri.net -u sl -c ''shirc -b 50 -t ''''#plan9'''''''
		window -scroll -r 2 412 641 552 'label 9front; cpu -h mars2.inri.net -u sl -c ''shirc -b 50 -t ''''#9front'''''''
		window -scroll -r 2 548 641 1024 'label cat-v; cpu -h mars2.inri.net -u sl -c ''shirc -b 50 -t ''''#cat-v'''''''
#		wi
	case *
		window -scroll -r 2 0 640 1024 'label left; rc'
	}
}
if not if(~ $w 1376 && ~ $h 768){
	switch($1){
	case -i
		window -scroll -r 2 0 678 72 'label freenode; cpu -h mars2.inri.net -u sl -c ''shirc'''
		window -scroll -r 2 68 678 159 'label inferno; cpu -h mars2.inri.net -u sl -c ''shirc -b 50 -t sampuru'''
		window -scroll -r 2 155 678 255 'label plan9; cpu -h mars2.inri.net -u sl -c ''shirc -b 50 -t ''''#plan9'''''''
		window -scroll -r 2 251 678 360 'label aiju; cpu -h mars2.inri.net -u sl -c ''shirc -b 50 -t aiju'''
		window -scroll -r 2 251 678 360 'label 9front; cpu -h mars2.inri.net -u sl -c ''shirc -b 50 -t ''''#9front'''''''
		window -scroll -r 2 356 678 768 'label cat-v; cpu -h mars2.inri.net -u sl -c ''shirc -b 50 -t ''''#cat-v'''''''
#		wi
		if(grep -s bssid /net/ether0/ifstats)
			bssid
	case *
		window -scroll -r 2 0 678 768 'label left; rc'
	}
}
if not if(~ $w 1408 && ~ $h 1050){
	switch($1){
	case -i
		window -scroll -r 2 0 704 72 'label freenode; cpu -h mars2.inri.net -u sl -c ''shirc'''
		window -scroll -r 2 68 704 159 'label sampuru; cpu -h mars2.inri.net -u sl -c ''shirc -b 50 -t sampuru'''
		window -scroll -r 2 155 704 261 'label inferno; cpu -h mars2.inri.net -u sl -c ''shirc -b 50 -t ''''#inferno'''''''
		window -scroll -r 2 257 704 401 'label plan9; cpu -h mars2.inri.net -u sl -c ''shirc -b 50 -t ''''#plan9'''''''
		window -scroll -r 2 397 704 551 'label aiju; cpu -h mars2.inri.net -u sl -c ''shirc -b 50 -t aiju'''
		window -scroll -r 2 397 704 551 'label 9front; cpu -h mars2.inri.net -u sl -c ''shirc -b 50 -t ''''#9front'''''''
		window -scroll -r 2 547 704 1050 'label cat-v; cpu -h mars2.inri.net -u sl -c ''shirc -b 50 -t ''''#cat-v'''''''
#		wi
		if(grep -s bssid /net/ether0/ifstats)
			bssid
	case *
		window -scroll -r 2 0 704 1050 'label left; rc'
	}
}
if not if(~ $w 1440 && ~ $h 900){
	switch($1){
	case -i
		window -scroll -r 2 0 720 73 'label freenode; cpu -h mars2.inri.net -u sl -c ''shirc'''
		window -scroll -r 2 69 720 173 'label sampuru; cpu -h mars2.inri.net -u sl -c ''shirc -b 50 -t sampuru'''
		window -scroll -r 2 169 720 308 'label plan9; cpu -h mars2.inri.net -u sl -c ''shirc -b 50 -t ''''#plan9'''''''
		window -scroll -r 2 304 720 448 'label aiju; cpu -h mars2.inri.net -u sl -c ''shirc -b 50 -t aiju'''
		window -scroll -r 2 304 720 448 'label 9front; cpu -h mars2.inri.net -u sl -c ''shirc -b 50 -t ''''#9front'''''''
		window -scroll -r 2 445 720 900 'label cat-v; cpu -h mars2.inri.net -u sl -c ''shirc -b 50 -t ''''#cat-v'''''''
#		wi
		if(grep -s bssid /net/ether0/ifstats)
			bssid
	case *
		window -scroll -r 2 0 450 1439 'label left; rc'
	}
}
if not if(~ $w 1600 && ~ $h 1200){
	switch($1){
	case -2
		window -scroll -r 2 0 800 600 'label ltop; rc'
		window -scroll -r 2 596 800 1200 'label lbottom; rc'
	case -i
		window -scroll -r 2 0 800 78 'label freenode; cpu -h mars2.inri.net -u sl -c ''shirc'''
		window -scroll -r 2 74 800 176 'label sampuru; cpu -h mars2.inri.net -u sl -c ''shirc -b 50 -t sampuru'''
		window -scroll -r 2 172 800 282 'label inferno; cpu -h mars2.inri.net -u sl -c ''shirc -b 50 -t ''''#inferno'''''''
		window -scroll -r 2 278 800 463 'label plan9; cpu -h mars2.inri.net -u sl -c ''shirc -b 50 -t ''''#plan9'''''''
		window -scroll -r 2 459 800 670 'label aiju; cpu -h mars2.inri.net -u sl -c ''shirc -b 50 -t aiju'''
		window -scroll -r 2 459 800 670 'label 9front; cpu -h mars2.inri.net -u sl -c ''shirc -b 50 -t ''''#9front'''''''
		window -scroll -r 2 666 800 1200 'label cat-v; cpu -h mars2.inri.net -u sl -c ''shirc -b 50 -t ''''#cat-v'''''''
#		wi
	case *
		window -scroll -r 2 0 800 1200 'label left; rc'
	}
}
if not if(~ $w 1680 1696 && ~ $h 1050){
	switch($1){
	case -2
		window -scroll -r 2 0 840 525 'label ltop; rc'
		window -scroll -r 2 521 840 1080 'label lbottom; rc'
	case -i
		window -scroll -r 2 0 840 89 'label freenode; cpu -h mars2.inri.net -u sl -c ''shirc'''
		window -scroll -r 2 85 840 188 'label freenode; cpu -h mars2.inri.net -u sl -c ''shirc -b 50 -t sampuru'''
		window -scroll -r 2 184 840 308 'label inferno; cpu -h mars2.inri.net -u sl -c ''shirc -b 50 -t ''''#inferno'''''''
		window -scroll -r 2 304 840 465 'label plan9; cpu -h mars2.inri.net -u sl -c ''shirc -b 50 -t ''''#plan9'''''''
		window -scroll -r 2 461 840 607 'label 9front; cpu -h mars2.inri.net -u sl -c ''shirc -b 50 -t ''''#9front'''''''
		window -scroll -r 2 603 840 1050 'label cat-v; cpu -h mars2.inri.net -u sl -c ''shirc -b 50 -t ''''#cat-v'''''''
#		wi
	case *
		window -scroll -r 2 0 840 1050 'label left; rc'
	}
}
if not if(~ $w 1920 && ~ $h 1080){
	switch($1){
	case -2
		window -scroll -r 2 0 860 540 'label ltop; rc'
		window -scroll -r 2 540 860 1080 'label lbottom; rc'
	case -i
		window -scroll -r 2 0 960 124 'label freenode; cpu -h mars2.inri.net -u sl -c ''shirc'''
		window -scroll -r 2 121 960 222 'label inferno; cpu -h mars2.inri.net -u sl -c ''shirc -b 50 -t ''''#inferno'''''''
		window -scroll -r 2 218 960 393 'label plan9; cpu -h mars2.inri.net -u sl -c ''shirc -b 50 -t ''''#plan9'''''''
		window -scroll -r 2 389 960 670 'label 9front; cpu -h mars2.inri.net -u sl -c ''shirc -b 50 -t ''''#9front'''''''
		window -scroll -r 2 666 960 1080 'label cat-v; cpu -h mars2.inri.net -u sl -c ''shirc -b 50 -t ''''#cat-v'''''''
	case *
		window -scroll -r 2 0 960 1080 'label left; rc'
	}
}

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to webmaster@9p.io.