shithub: rc

ref: 094869e40b9ab8fb1bb2f548fbe3847f81710900
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

# tentative bar(1) placement, which is determined by riostart policy
barrect=( \
	`{echo $bsamrect(1) - 430 | pc -n} \
	`{echo $bsamrect(2) - 28 | pc -n} \
	$screensize(3) \
	$screensize(4) \
)

briorect=(0 0 $screensize(1) `{echo $screensize(2) - 16 | pc -n})
bsamrect=(0 32 $briorect(3) $briorect(4))
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} \
)
mailrect=( \
	0 \
	0 \
	`{echo $briorect(3) / 3 | pc -n} \
	$briorect(4) \
)
# force corner
vncrect=( \
	`{echo $screensize(1) - 160 | pc -n} \
	0 \
	$screensize(1) \
	64 \
)
ffvncrect=( \
	32 \
	32 \
	1320 \
	1064 \
)
vtrect=( \
	128 \
	0 \
	800 \
	$briorect(4) \
)

cat <<! >/tmp/sizes.$sysname
screensize=($screensize)
barrect=($barrect)
briorect=($briorect)
bsamrect=($bsamrect)
bcmdrect=($bcmdrect)
catrect=($catrect)
volrect=($volrect)
kprintrect=($kprintrect)
statrect=($statrect)
cmdrect=($cmdrect)
riowrect=($riowrect)
zukerect=($zukerect)
duckrect=($duckrect)
mailrect=($mailrect)
vncrect=($vncrect)
ffvncrect=($ffvncrect)
vtrect=($vtrect)
!