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

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


#!/bin/rc
# setup right 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 -3
		window -scroll -r 361 39 1024 768 'label tw; rc'
		window -scroll -r 361 39 1024 768 'label kprint; rc -c ''cat /dev/kprint'''
		window -scroll -r 361 39 1024 768 'label osuny; rc'
	case *
		window -scroll -r 361 39 1024 768 'label right; rc'
	}
}
if not if(~ $w 1280 && ~ $h 800){
	switch($1){
	case -6
		window -scroll -r 636 39 1278 800 'label tw; rc'
		window -scroll -r 636 39 1278 800 'label kprint; rc -c ''cat /dev/kprint'''
		window -scroll -r 636 39 1278 800 'label sp; rc -c ''v -m'''
		window -scroll -r 636 179 1278 800 'label osuny; rc'
	case *
		window -scroll -r 636 39 1278 800 'label right; rc'
	}
}
if not if(~ $w 1280 && ~ $h 1024){
	switch($1){
	case -6
		window -scroll -r 636 107 1278 908 'label tw; rc'
		window -r 636 107 1278 908 'label newt; rc'
		window -scroll -r 636 107 1278 908 'label osuny; rc'
		window -r 636 107 1278 908 'label man; rc'
		window -scroll -r 636 904 1278 1024 'label cmd; rc'
	case *
		window -scroll -r 636 39 1278 1024 'label right; rc'
	}
}
if not if(~ $w 1376 && ~ $h 768){
	switch($1){
	case -6
		window -scroll -r 837 111 1365 684 'label tw; rc'
		window -hide -r 674 111 1365 684 'label newt; rc'
		window -scroll -r 674 111 1365 684 'label osuny; rc'
		window -r 674 111 1365 684 'label man; rc'
		window -scroll -r 674 680 1365 768 'label cmd; rc'
	case *
		window -scroll -r 674 111 1365 768 'label right; rc'
	}
}
if not if(~ $w 1408 && ~ $h 1050){
	switch($1){
	case -6
		window -scroll -r 871 111 1400 966 'label tw; rc'
		window -hide -r 699 111 1400 966 'label newt; rc'
		window -scroll -r 699 111 1400 966 'label osuny; rc'
		window -r 699 111 1400 966 'label man; rc'
		window -scroll -r 700 962 1400 1050 'label cmd; rc'
	case *
		window -scroll -r 700 0 1400 1050 'label right; rc'
	}
}
if not if(~ $w 1440 && ~ $h 900){
	switch($1){
	case -6
		window -scroll -r 938 111 1439 813 'label tw; rc'
		window -scroll -r 716 39 1121 81 'label kprint; rc -c ''cat /dev/kprint'''
		window -r 716 111 1439 813 'label newt; rc'
		window -scroll -r 716 111 1439 813 'label osuny; rc'
		window -r 716 111 1439 813 'label man; rc'
		window -scroll -r 716 809 1440 900 'label cmd; rc'
	case *
		window -scroll -r  'label right; rc'
	}
}
if not if(~ $w 1600 && ~ $h 1200){
	switch($1){
	case -6
		window -scroll -r 1055 111 1597 1032 'label tw; rc'
		window -r 796 111 1597 1032 'label newt; rc'
		window -scroll -r 796 111 1597 1032 'label osuny; rc'
		window -r 796 111 1597 1032 'label man; rc'
		window -scroll -r 796 1028 1597 1200 'label cmd; rc'
	case *
		window -scroll -r 796 2 1597 1200 'label right; rc'
	}
}
if not if(~ $w 1680 1696 && ~ $h 1050){
	switch($1){
	case -6
		window -scroll -r 1144 111 1678 864 'label tw; rc'
		window -r 836 111 1678 864 'label newt; rc'
		window -scroll -r 836 111 1678 864 'label osuny; rc'
		window -r 836 111 1678 864 'label man; rc'
		window -scroll -r 836 860 1678 1050 'label cmd; rc'
	case *
		window -scroll -r 836 39 1614 864 'label right; rc'
	}
}
if not if(~ $w 1920 && ~ $h 1080){
	switch($1){
	case -6
		window -scroll -r 1184 39 1918 1010 'label tw; rc'
		window -r 1184 39 1918 1010 'label newt; rc'
		window -scroll -r 1184 39 1918 1010 'label osuny; rc'
		window -r 1184 39 1918 1010 'label man; rc'
		window -scroll -r 956 1006 1918 1079 'label cmd; rc'
	case *
		window -scroll -r 956 39 1855 1010 'label right; 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.