2009-09-10 14:37:33 +02:00
|
|
|
{ config, pkgs, ... }:
|
|
|
|
|
|
|
|
with pkgs.lib;
|
|
|
|
|
|
|
|
let cfg = config.services.xserver.synaptics; in
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
options = {
|
|
|
|
|
|
|
|
services.xserver.synaptics = {
|
|
|
|
|
|
|
|
enable = mkOption {
|
|
|
|
default = false;
|
|
|
|
example = true;
|
|
|
|
description = "Whether to enable touchpad support.";
|
|
|
|
};
|
|
|
|
|
|
|
|
dev = mkOption {
|
2010-08-10 16:13:57 +02:00
|
|
|
default = null;
|
|
|
|
example = "/dev/input/event0";
|
|
|
|
description =
|
|
|
|
''
|
|
|
|
Path for touchpad device. Set to null to apply to any
|
|
|
|
auto-detected touchpad.
|
|
|
|
'';
|
2009-09-10 14:37:33 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
minSpeed = mkOption {
|
2010-08-02 21:06:42 +02:00
|
|
|
default = "0.6";
|
2009-09-10 14:37:33 +02:00
|
|
|
description = "Cursor speed factor for precision finger motion.";
|
|
|
|
};
|
|
|
|
|
|
|
|
maxSpeed = mkOption {
|
2010-08-02 21:06:42 +02:00
|
|
|
default = "1.0";
|
2009-09-10 14:37:33 +02:00
|
|
|
description = "Cursor speed factor for highest-speed finger motion.";
|
|
|
|
};
|
|
|
|
|
|
|
|
twoFingerScroll = mkOption {
|
|
|
|
default = false;
|
|
|
|
description = "Whether to enable two-finger drag-scrolling.";
|
|
|
|
};
|
|
|
|
|
2010-08-02 21:06:42 +02:00
|
|
|
vertEdgeScroll = mkOption {
|
|
|
|
default = true;
|
|
|
|
description = "Whether to enable vertical edge drag-scrolling.";
|
|
|
|
};
|
|
|
|
|
2009-09-10 14:37:33 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
config = mkIf cfg.enable {
|
|
|
|
|
|
|
|
services.xserver.modules = [ pkgs.xorg.xf86inputsynaptics ];
|
|
|
|
|
|
|
|
services.xserver.config =
|
|
|
|
''
|
2010-08-10 16:13:57 +02:00
|
|
|
# Automatically enable the synaptics driver for all touchpads.
|
|
|
|
Section "InputClass"
|
2010-09-03 21:10:45 +02:00
|
|
|
Identifier "synaptics touchpad catchall"
|
2010-08-10 16:13:57 +02:00
|
|
|
MatchIsTouchpad "on"
|
|
|
|
${optionalString (cfg.dev != null) ''MatchDevicePath "${cfg.dev}"''}
|
2010-09-03 21:10:45 +02:00
|
|
|
Driver "synaptics"
|
2009-09-10 14:37:33 +02:00
|
|
|
Option "MaxTapTime" "180"
|
|
|
|
Option "MaxTapMove" "220"
|
|
|
|
Option "MinSpeed" "${cfg.minSpeed}"
|
|
|
|
Option "MaxSpeed" "${cfg.maxSpeed}"
|
|
|
|
Option "AccelFactor" "0.0010"
|
|
|
|
Option "TapButton1" "1"
|
|
|
|
Option "TapButton2" "2"
|
|
|
|
Option "TapButton3" "3"
|
|
|
|
Option "VertTwoFingerScroll" "${if cfg.twoFingerScroll then "1" else "0"}"
|
|
|
|
Option "HorizTwoFingerScroll" "${if cfg.twoFingerScroll then "1" else "0"}"
|
2010-08-02 21:06:42 +02:00
|
|
|
Option "VertEdgeScroll" "${if cfg.vertEdgeScroll then "1" else "0"}"
|
2009-09-10 14:37:33 +02:00
|
|
|
EndSection
|
|
|
|
'';
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|