From 2e0a569187991b815af91773e0c23546e1184a16 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Tue, 10 Aug 2010 14:13:57 +0000 Subject: [PATCH] * Use InputClass in the synaptics module to automatically use the synaptics driver for all touchpads (unless the "dev" option is set). * Get rid of some synaptics options: SHMConfig, Repeater (obsolete); *Edge (usually auto-detected), Protocol (use auto-detect instead). svn path=/nixos/trunk/; revision=23092 --- modules/services/x11/hardware/synaptics.nix | 33 ++++++++------------- modules/services/x11/xserver.nix | 2 +- 2 files changed, 13 insertions(+), 22 deletions(-) diff --git a/modules/services/x11/hardware/synaptics.nix b/modules/services/x11/hardware/synaptics.nix index 5f832ab7d22..a8abe87ea2b 100644 --- a/modules/services/x11/hardware/synaptics.nix +++ b/modules/services/x11/hardware/synaptics.nix @@ -17,9 +17,13 @@ let cfg = config.services.xserver.synaptics; in }; dev = mkOption { - default = "/dev/input/event0"; - example = null; - description = "Event device for Synaptics touchpad, null to omit specification."; + default = null; + example = "/dev/input/event0"; + description = + '' + Path for touchpad device. Set to null to apply to any + auto-detected touchpad. + ''; }; minSpeed = mkOption { @@ -53,25 +57,17 @@ let cfg = config.services.xserver.synaptics; in services.xserver.config = '' - Section "InputDevice" - Identifier "Touchpad[0]" + # Automatically enable the synaptics driver for all touchpads. + Section "InputClass" + Identifier "touchpad catchall" Driver "synaptics" - ${if cfg.dev != null then ''Option "Device" "${cfg.dev}"'' else ""} - Option "Protocol" "PS/2" - Option "LeftEdge" "1700" - Option "RightEdge" "5300" - Option "TopEdge" "1700" - Option "BottomEdge" "4200" - Option "FingerLow" "25" - Option "FingerHigh" "30" + MatchIsTouchpad "on" + ${optionalString (cfg.dev != null) ''MatchDevicePath "${cfg.dev}"''} Option "MaxTapTime" "180" Option "MaxTapMove" "220" - Option "VertScrollDelta" "100" Option "MinSpeed" "${cfg.minSpeed}" Option "MaxSpeed" "${cfg.maxSpeed}" Option "AccelFactor" "0.0010" - Option "SHMConfig" "on" - Option "Repeater" "/dev/input/mice" Option "TapButton1" "1" Option "TapButton2" "2" Option "TapButton3" "3" @@ -81,11 +77,6 @@ let cfg = config.services.xserver.synaptics; in EndSection ''; - services.xserver.serverLayoutSection = - '' - InputDevice "Touchpad[0]" "CorePointer" - ''; - }; } diff --git a/modules/services/x11/xserver.nix b/modules/services/x11/xserver.nix index 8276f116223..900ed00f4b4 100644 --- a/modules/services/x11/xserver.nix +++ b/modules/services/x11/xserver.nix @@ -462,7 +462,7 @@ in EndSection Section "InputClass" - Identifier "Keyboards catch all" + Identifier "Keyboard catchall" MatchIsKeyboard "on" Option "XkbRules" "base" Option "XkbModel" "${cfg.xkbModel}"