diff options
author | Corey O'Connor <coreyoconnor@gmail.com> | 2014-02-16 23:58:51 -0800 |
---|---|---|
committer | Corey O'Connor <coreyoconnor@gmail.com> | 2014-02-24 16:03:47 -0800 |
commit | 20567eba1f740350932ba5643c2613204488a396 (patch) | |
tree | 7311e26d5e69608d756ce02002cfd79df859ab96 /nixos/modules/services/x11/hardware | |
parent | 9c36f01edd6b339f16938fcf66b191e363edd504 (diff) |
correct tapButtons in synaptics config. Dont rely on the X11 input settings to take the last option.
Diffstat (limited to 'nixos/modules/services/x11/hardware')
-rw-r--r-- | nixos/modules/services/x11/hardware/synaptics.nix | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/nixos/modules/services/x11/hardware/synaptics.nix b/nixos/modules/services/x11/hardware/synaptics.nix index 91e01f2e30b1..fe9dcd51a7a6 100644 --- a/nixos/modules/services/x11/hardware/synaptics.nix +++ b/nixos/modules/services/x11/hardware/synaptics.nix @@ -2,9 +2,23 @@ with pkgs.lib; -let cfg = config.services.xserver.synaptics; in - -{ +let cfg = config.services.xserver.synaptics; + tapConfig = if cfg.tapButtons then enabledTapConfig else disabledTapConfig; + enabledTapConfig = '' + Option "MaxTapTime" "180" + Option "MaxTapMove" "220" + Option "TapButton1" "${builtins.elemAt cfg.buttonsMap 0}" + Option "TapButton2" "${builtins.elemAt cfg.buttonsMap 1}" + Option "TapButton3" "${builtins.elemAt cfg.buttonsMap 2}" + ''; + disabledTapConfig = '' + Option "MaxTapTime" "0" + Option "MaxTapMove" "0" + Option "TapButton1" "0" + Option "TapButton2" "0" + Option "TapButton3" "0" + ''; +in { options = { @@ -106,15 +120,10 @@ let cfg = config.services.xserver.synaptics; in MatchIsTouchpad "on" ${optionalString (cfg.dev != null) ''MatchDevicePath "${cfg.dev}"''} Driver "synaptics" - Option "MaxTapTime" "180" - Option "MaxTapMove" "220" Option "MinSpeed" "${cfg.minSpeed}" Option "MaxSpeed" "${cfg.maxSpeed}" Option "AccelFactor" "${cfg.accelFactor}" - ${if cfg.tapButtons then "" else ''Option "MaxTapTime" "0"''} - Option "TapButton1" "${builtins.elemAt cfg.buttonsMap 0}" - Option "TapButton2" "${builtins.elemAt cfg.buttonsMap 1}" - Option "TapButton3" "${builtins.elemAt cfg.buttonsMap 2}" + ${optionalString cfg.tapButtons tapConfig} Option "ClickFinger1" "${builtins.elemAt cfg.buttonsMap 0}" Option "ClickFinger2" "${builtins.elemAt cfg.buttonsMap 1}" Option "ClickFinger3" "${builtins.elemAt cfg.buttonsMap 2}" |