diff options
author | cinap_lenrek <cinap_lenrek@felloff.net> | 2015-09-05 03:14:44 +0200 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@felloff.net> | 2015-09-05 03:14:44 +0200 |
commit | 10f680c5baf1cec1ba630bb63e6fc022bf9d26ad (patch) | |
tree | 51ad9e2f6c11312029eba69e7727befacee7f0a7 /rc | |
parent | ce38e57e97b39b0cde532ff6a83b8881de6d2f3a (diff) | |
download | plan9front-10f680c5baf1cec1ba630bb63e6fc022bf9d26ad.tar.xz |
move screen and mouse setup code to /rc/bin/screenrc
Diffstat (limited to 'rc')
-rwxr-xr-x | rc/bin/screenrc | 48 | ||||
-rwxr-xr-x | rc/bin/termrc | 42 |
2 files changed, 49 insertions, 41 deletions
diff --git a/rc/bin/screenrc b/rc/bin/screenrc new file mode 100755 index 000000000..5aaebca68 --- /dev/null +++ b/rc/bin/screenrc @@ -0,0 +1,48 @@ +#!/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){ + 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 -f /dev/mousectl && test -f '#i/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' diff --git a/rc/bin/termrc b/rc/bin/termrc index bb4e36499..cd40ec7a6 100755 --- a/rc/bin/termrc +++ b/rc/bin/termrc @@ -76,47 +76,7 @@ if(! ~ $terminal *vx32*){ } # 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){ - 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 -f /dev/mousectl && test -f '#i/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' +screenrc if(test -f /dev/apm) aux/apm |