]> git.lizzy.rs Git - plan9front.git/blob - rc/bin/screenrc
5aaebca68c75cad2336d8be16205cd2879e690d0
[plan9front.git] / rc / bin / screenrc
1 #!/bin/rc
2
3 # setup mouse and graphics
4
5 fn ask {
6         if(~ $"$1 ask){
7                 echo -n $1
8                 echo -n $2
9                 echo -n ' ['
10                 echo -n $3
11                 echo -n '] '
12                 $1=`{read}
13                 if(~ $"$1 '!rc'){
14                         rc -i
15                         $1=ask
16                 }
17                 if(~ $#$1 0)
18                         $1=$3
19                 ask $*
20         }
21 }
22
23 if(test -f /dev/vgactl){
24         ask vgasize ' is (text, 640x480x8, 1024x768x16, ...)' 1024x768x16
25         if(! ~ $"vgasize '' text none){
26                 ask monitor ' is (vesa, xga, lcd, ...)' vesa
27                 if(! ~ $"monitor ''){
28                         @{
29                                 rfork n
30                                 if(~ $monitor vesa)
31                                         aux/realemu
32                                 aux/vga -l $vgasize
33                         }
34                 }
35         }
36 }
37
38 if(test -f /dev/mousectl && test -f '#i/winname'){
39         ask mouseport ' is (ps2, ps2intellimouse, 0, 1, 2)' ps2
40         switch($mouseport){
41         case ps2 ps2intellimouse 0 1 2
42                 aux/mouse $mouseport
43                 if(~ $accupoint 1)
44                         pipefile -dr /bin/aux/accupoint /dev/mouse
45         }
46 }
47
48 rm -f '/env/fn#ask'