summaryrefslogtreecommitdiff
path: root/rc/bin/screenrc
blob: 5803819d3980a0ce5092ca0ad4c560c4d283cb8d (plain)
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/bin/rc

# setup mouse and graphics

fn ask {
	if(~ $"$1 ask){
		echo -n $1
		echo -n $2
		echo -n ' ['
		echo -n $3
		echo -n '] '
		$1=`{read}
		if(~ $"$1 '!rc'){
			rc -i
			$1=ask
		}
		if(~ $#$1 0)
			$1=$3
		ask $*
	}
}

if(test -f /dev/vgactl || bind -a '#v' /dev >[2] /dev/null){
	ask vgasize ' is (text, 640x480x8, 1024x768x16, ...)' 1024x768x16
	if(! ~ $"vgasize '' text none){
		ask monitor ' is (vesa, xga, lcd, ...)' vesa
		if(! ~ $"monitor ''){
			@{
				rfork n
				if(~ $monitor vesa)
					aux/realemu
				aux/vga -l $vgasize
			}
		}
	}
}

if(! test -d /dev/draw)
	bind -a '#i' /dev

if(! test -f /dev/mouse)
	bind -a '#m' /dev

if(test -f /dev/mousectl && test -f /dev/winname){
	ask mouseport ' is (ps2, ps2intellimouse, 0, 1, 2)' ps2
	switch($mouseport){
	case ps2 ps2intellimouse 0 1 2
		aux/mouse $mouseport
		if(~ $accupoint 1)
			pipefile -dr /bin/aux/accupoint /dev/mouse
	}
}

rm -f '/env/fn#ask'