Added synaptics support to xserver upstart-job.

svn path=/nixos/trunk/; revision=9366
This commit is contained in:
Michael Raskin 2007-09-24 09:02:43 +00:00
parent 8f126de2fb
commit a34885af7e
4 changed files with 54 additions and 5 deletions

View File

@ -686,6 +686,24 @@
}
{
name = ["services" "xserver" "isSynaptics"];
default = false;
example = true;
description = "
Whether to replace mouse with touchpad.
";
}
{
name = ["services" "xserver" "devSynaptics"];
default = "/dev/input/event0";
description = "
Event device for Synaptics touchpad.
";
}
{
name = ["services" "httpd" "enable"];

View File

@ -158,7 +158,7 @@ import ../upstart-jobs/gather.nix {
inherit config;
inherit (pkgs) stdenv writeText lib xterm slim xorg mesa
gnome compiz feh kdebase kdelibs xkeyboard_config
openssh x11_ssh_askpass nvidiaDrivers;
openssh x11_ssh_askpass nvidiaDrivers synaptics;
libX11 = pkgs.xlibs.libX11;
libXext = pkgs.xlibs.libXext;
fontDirectories = import ../system/fonts.nix {inherit pkgs;};

View File

@ -39,6 +39,7 @@ Section "InputDevice"
Option "Device" "/dev/input/mice"
EndSection
@synapticsInputDevice@
Section "Monitor"
Identifier "Monitor[0]"
@ -83,7 +84,7 @@ EndSection
Section "ServerLayout"
Identifier "Layout[all]"
InputDevice "Keyboard[0]" "CoreKeyboard"
InputDevice "Mouse[0]" "CorePointer"
InputDevice "@corePointer@" "CorePointer"
Screen "Screen[0]"
EndSection

View File

@ -4,6 +4,7 @@
, xkeyboard_config
, openssh, x11_ssh_askpass
, nvidiaDrivers, libX11, libXext
, synaptics
, config
@ -64,13 +65,42 @@ let
++ optional (videoDriver == "vesa") xorg.xf86videovesa
++ optional (videoDriver == "sis") xorg.xf86videosis
++ optional (videoDriver == "i810") xorg.xf86videoi810
++ optional (videoDriver == "intel") xorg.xf86videointel;
++ optional (videoDriver == "intel") xorg.xf86videointel
++ (optional (getCfg "isSynaptics") [(synaptics+"/"+xorg.xorgserver) xorg.xf86inputevdev]);
configFile = stdenv.mkDerivation {
name = "xserver.conf";
src = ./xserver.conf;
inherit fontDirectories videoDriver resolutions isClone;
inherit fontDirectories videoDriver resolutions isClone synaptics;
synapticsInputDevice = (if getCfg "isSynaptics" then "
Section \"InputDevice\"
Identifier \"Touchpad[0]\"
Driver \"synaptics\"
Option \"Device\" \""+(getCfg "devSynaptics")+"\"
Option \"Protocol\" \"PS/2\"
Option \"LeftEdge\" \"1700\"
Option \"RightEdge\" \"5300\"
Option \"TopEdge\" \"1700\"
Option \"BottomEdge\" \"4200\"
Option \"FingerLow\" \"25\"
Option \"FingerHigh\" \"30\"
Option \"MaxTapTime\" \"180\"
Option \"MaxTapMove\" \"220\"
Option \"VertScrollDelta\" \"100\"
Option \"MinSpeed\" \"0.06\"
Option \"MaxSpeed\" \"0.12\"
Option \"AccelFactor\" \"0.0010\"
Option \"SHMConfig\" \"on\"
Option \"Repeater\" \"/dev/input/mice\"
Option \"TapButton1\" \"1\"
Option \"TapButton2\" \"2\"
Option \"TapButton3\" \"3\"
EndSection " else "");
corePointer = (if getCfg "isSynaptics" then "Touchpad[0]" else "Mouse[0]");
buildCommand = "
buildCommand= # urgh, don't substitute this