shithub: rc

ref: 6213abf8bc893f3d18fa701c248c6316bd473cc6
dir: /bin/sizes/

View raw version
#!/bin/rc
screensize=`{echo $vgasize | sed 's/x/ /g'}
#screensize=`{file /dev/screen | sed 's/.*size ([^x]+)x([^x]+)/\1 \2/'}
# general placements
briorect=(0 0 $screensize(1) `{echo $screensize(2) - 16 | pc -n})
bsamrect=(0 0 $briorect(3) `{echo $briorect(4) - 64 | pc -n})
bcmdrect=( \
	0 \
	`{echo $bsamrect(4) - $bsamrect(4) / 3 | pc -n} \
	`{echo $bsamrect(3) / 3 | pc -n} \
	$briorect(4) \
)
# default windows
catrect=( \
	0 \
	0 \
	130 \
	296 \
)
volrect=( \
	`{echo $catrect(3) + 4 | pc -n} \
	0 \
	768 \
	28 \
)
kprintrect=( \
	$volrect(1) \
	`{echo $volrect(4) + 4 | pc -n} \
	$volrect(3) \
	`{echo $catrect(4) / 2 | pc -n} \
)
statrect=( \
	$volrect(1) \
	`{echo $kprintrect(4) + 4 | pc -n} \
	$volrect(3) \
	$catrect(4) \
)
cmdrect=( \
	0 \
	`{echo $catrect(4) + 4 | pc -n} \
	$volrect(3) \
	$screensize(2) \
)
riowrect=( \
	`{echo $screensize(1) - 100 | pc -n} \
	`{echo $screensize(2) - 28 | pc -n} \
	$screensize(1) \
	$screensize(2) \
)
zukerect=( \
	`{echo $screensize(1) - 768 | pc -n} \
	0 \
	$screensize(1) \
	$screensize(2) \
)
duckrect=( \
	`{echo $screensize(1) / 2 | pc -n} \
	0 \
	$screensize(1) \
	`{echo $screensize(2) - 256 | pc -n} \
)

cat <<! >/tmp/sizes
screensize=($screensize)
briorect=($briorect)
bsamrect=($bsamrect)
bcmdrect=($bcmdrect)
catrect=($catrect)
volrect=($volrect)
kprintrect=($kprintrect)
statrect=($statrect)
cmdrect=($cmdrect)
riowrect=($riowrect)
zukerect=($zukerect)
duckrect=($duckrect)
!