~kris/dots

srice

srice/profiles/9front/bin/riostart/common.rc -rw-r--r-- 452 bytes
e98f3b03 — Kris Yotam chore: sync local state after restore (push updates, no pull) a month ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
fn ScrDim{  # determine screen dimension (W H)
  w=0
  h=0
  devscr=/dev/screen
  if(test -r $devscr){
    scr=`{read -c 59 $devscr}
    w=`{echo $scr(4) - $scr(2) | bc}
    h=`{echo $scr(5) - $scr(3) | bc}
  }
  if not {
    dim=(`{echo $vgasize | awk -Fx '{printf("%d %d", $1, $2)}'})
    w=$dim(1)
    h=$dim(2)
  }
  echo $w $h
}

fn PutWsDim{
	w=$1
	h=$2
	echo $w $h >$home/tmp/riostart.ws.dim
}

fn GetWsDim{
	read -m $home/tmp/riostart.ws.dim
}