diff options
author | cinap_lenrek <cinap_lenrek@felloff.net> | 2014-11-05 20:42:47 +0100 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@felloff.net> | 2014-11-05 20:42:47 +0100 |
commit | 0560d1d6b657294de891017e1f9c56cf4db07360 (patch) | |
tree | 2b98f239c599b1f2f114e7fa7c0fd397d4a656d6 | |
parent | 3f09d4b623b0e47d0f1dc6ced19345c0d9454834 (diff) | |
download | plan9front-0560d1d6b657294de891017e1f9c56cf4db07360.tar.xz |
termrc: setup mouse when we have a framebuffer
previously, we setup mouse only when vgasize= was specifid in
plan9.ini. with efi systems, the framebuffer is already setup
for us and theres no requirement for going thru aux/vga setup,
but we still want to setup the mouse.
so do the mouseport= check once theres a framebuffer by testing
the existence of '#i/winname' (which fails when thers no
framebuffer).
-rwxr-xr-x | rc/bin/termrc | 41 |
1 files changed, 21 insertions, 20 deletions
diff --git a/rc/bin/termrc b/rc/bin/termrc index 38face215..bb4e36499 100755 --- a/rc/bin/termrc +++ b/rc/bin/termrc @@ -75,6 +75,7 @@ if(! ~ $terminal *vx32*){ aux/timesync $TIMESYNCARGS } +# setup mouse and graphics fn ask { if(~ $"$1 ask){ echo -n $1 @@ -92,29 +93,29 @@ fn ask { ask $* } } - -ask vgasize ' is (text, 640x480x8, 1024x768x16, ...)' 1024x768x16 -if(! ~ $"vgasize '' text none){ - ask monitor ' is (vesa, xga, lcd, ...)' vesa - if(! ~ $"monitor ''){ - if(test -f /dev/mousectl) - ask mouseport ' is (ps2, ps2intellimouse, 0, 1, 2)' ps2 - if not - mouseport=none - @{ - rfork n - if(~ $monitor vesa) - aux/realemu - aux/vga -l $vgasize - } - switch($mouseport){ - case ps2 ps2intellimouse 0 1 2 - aux/mouse $mouseport - if(~ $accupoint 1) - pipefile -dr /bin/aux/accupoint /dev/mouse +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' if(test -f /dev/apm) |