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

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


#!/bin/rc
# setup header screen
# screen positions below assume a font with an 7px height.
# window may fail silently if a larger font cannot fit.
rfork en
if(grep -s wayport.net /net/ndb)
	fs=/n/cpu.net/tcp!fs
if not
	fs=fs
scr=(`{cat /dev/draw/new >[2]/dev/null})
w=$scr(11)
h=$scr(12)
if(~ $w 639 && ~ $h 480){
	# nothing to see here
}
if not if(~ $w 1024 && ~ $h 768){
	#window -r 2 0 400 54 winwatch -e '''^(auth|faces|stats|winwatch|<unnamed>)'' -f '$font
	window -r 802 2 1024 54 stats -Llcme
	#font=/lib/font/bit/lucidasans/boldunicode.7.font @{while(){ hstats; sleep 60 }} | aux/statusmsg -w 398,0,805,54 &
}
if not if(~ $w 1280 && ~ $h 800){
	window -r 2 0 556 54 winwatch -e '''^(auth|faces|stats|winwatch|<unnamed>)'' -f' $font
	window -r 1015 0 1280 54 stats -Llcme
	#font=/lib/font/bit/lucidasans/boldunicode.7.font @{while(){ hstats; sleep 60 }} | aux/statusmsg -w 552,0,1018,54 &
}
if not if(~ $w 1280 && ~ $h 1024){
	#window -r 2 0 487 54 winwatch -e '''^(auth|faces|stats|winwatch|<unnamed>)'' -f '$font
	window -r 636 0 945 110 stats -Llcme $fs /n/cpu.net/tcp!cpu mars2.inri.net pp.inri.net nm.inri.net $sysname
	window -scroll -r 636 0 945 111 'label kprint; rc -c ''cat /dev/kprint'''
	#font=/lib/font/bit/lucidasans/boldunicode.7.font @{while(){ hstats; sleep 60 }} | aux/statusmsg -w 976,0,1279,54 &
	window -r 941 0 1280 111 faces -i
}
if not if(~ $w 1376 && ~ $h 768){
	#window -r 2 0 487 54 winwatch -e '''^(auth|faces|stats|winwatch|<unnamed>)'' -f '$font
	window -r 674 0 1009 115 stats -Llcme $fs cpu.stanleylieber.com mars2.inri.net pp.inri.net nm.inri.net $sysname
	window -scroll -r 674 0 1009 115 'label kprint; rc -c ''cat /dev/kprint'''
	#font=/lib/font/bit/lucidasans/boldunicode.7.font @{while(){ hstats; sleep 60 }} | aux/statusmsg -w 1048,0,1365,54 &
	window -r 1004 0 1365 115 faces -i
}
if not if(~ $w 1408 && ~ $h 1050){
	#window -r 2 0 487 54 winwatch -e '''^(auth|faces|stats|winwatch|<unnamed>)'' -f '$font
	window -r 700 0 1040 115 stats -Llcme $fs cpu.stanleylieber.com mars2.inri.net pp.inri.net nm.inri.net $sysname
	window -scroll -r 700 0 1040 115 'label kprint; rc -c ''cat /dev/kprint'''
	#font=/lib/font/bit/lucidasans/boldunicode.7.font @{while(){ hstats; sleep 60 }} | aux/statusmsg -w 1048,0,1365,54 &
	window -r 1035 0 1400 115 faces -i
}
if not if(~ $w 1440 && ~ $h 900){
	#window -r 2 1 500 54 winwatch -e '''^(auth|faces|stats|winwatch|<unnamed>)'' -f '$font
	window -r 716 0 1103 115 stats -Llcme $fs cpu.stanleylieber.com mars2.inri.net pp.inri.net nm.inri.net $sysname
	window -scroll -r 716 0 1103 115 'label kprint; rc -c ''cat /dev/kprint'''
	#font=/lib/font/bit/lucidasans/boldunicode.7.font @{while(){ hstats; sleep 60 }} | aux/statusmsg -w 497,0,1017,54 &
	window -r 1099 0 1440 115 faces -i
}
if not if(~ $w 1600 && ~ $h 1200){
	#window -r 2 0 539 54 winwatch -e '''^(auth|faces|stats|winwatch|<unnamed>)'' -f '$font
	window -r 796 0 1210 115  stats -Llcme $fs cpu.stanleylieber.com mars2.inri.net pp.inri.net nm.inri.net $sysname
	window -scroll -r 796 0 1210 115 'label kprint; rc -c ''cat /dev/kprint'''
	#font=/lib/font/bit/lucidasans/boldunicode.7.font @{while(){ hstats; sleep 60 }} | aux/statusmsg -w 1281,0,1599,54 &
	window -r 1206 0 1597 115 faces -i
}
if not if(~ $w 1680 1696 && ~ $h 1050){
	#window -r 2 0 539 54 winwatch -e '''^(auth|faces|stats|winwatch|<unnamed>)'' -f '$font
	window -r 836 0 1261 115 stats -Llcme $fs cpu.stanleylieber.com mars2.inri.net pp.inri.net nm.inri.net $sysname
	window -scroll -r 836 0 1261 115 'label kprint; rc -c ''cat /dev/kprint'''
	#font=/lib/font/bit/lucidasans/boldunicode.7.font @{while(){ hstats; sleep 60 }} | /bin/aux/statusmsg -w 1335,0,1679,85 &
	window -r 1257 0 1680 115 faces -i
}
if not if(~ $w 1920 && ~ $h 1080){
	window -r 2 0 656 54 winwatch -e '''^(auth|faces|stats|winwatch|<unnamed>)'' -f '$font
	window -r 1183 0 1918 54 stats -Llcme $fs cpu.stanleylieber.com mars2.inri.net pp.inri.net nm.inri.net $sysname
	#font=/lib/font/bit/lucidasans/boldunicode.7.font @{while(){ hstats; sleep 60 }} | aux/statusmsg -w 652,0,1187,54 &
}

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.