summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authorKirill Elagin <kirelagin@gmail.com>2013-11-03 13:00:49 +0400
committerKirill Elagin <kirelagin@gmail.com>2013-11-03 13:00:49 +0400
commitfce38e454ba86b5ef3aff2f3be926033112bfa62 (patch)
treea078f00000aacc2dc6eb74d7b2e9fe3d33f58baa /nixos
parenteab39f9dda288581d393739f39353bbb10a7806c (diff)
downloadnixlib-fce38e454ba86b5ef3aff2f3be926033112bfa62.tar
nixlib-fce38e454ba86b5ef3aff2f3be926033112bfa62.tar.gz
nixlib-fce38e454ba86b5ef3aff2f3be926033112bfa62.tar.bz2
nixlib-fce38e454ba86b5ef3aff2f3be926033112bfa62.tar.lz
nixlib-fce38e454ba86b5ef3aff2f3be926033112bfa62.tar.xz
nixlib-fce38e454ba86b5ef3aff2f3be926033112bfa62.tar.zst
nixlib-fce38e454ba86b5ef3aff2f3be926033112bfa62.zip
Make touchpad button mapping configurable
Diffstat (limited to 'nixos')
-rw-r--r--nixos/modules/services/x11/hardware/synaptics.nix16
1 files changed, 13 insertions, 3 deletions
diff --git a/nixos/modules/services/x11/hardware/synaptics.nix b/nixos/modules/services/x11/hardware/synaptics.nix
index 5884e9aa31c8..91e01f2e30b1 100644
--- a/nixos/modules/services/x11/hardware/synaptics.nix
+++ b/nixos/modules/services/x11/hardware/synaptics.nix
@@ -57,6 +57,13 @@ let cfg = config.services.xserver.synaptics; in
         description = "Whether to enable tap buttons.";
       };
 
+      buttonsMap = mkOption {
+        default = [1 2 3];
+        example = [1 3 2];
+        description = "Remap touchpad buttons.";
+        apply = map toString;
+      };
+
       palmDetect = mkOption {
         default = false;
         example = true;
@@ -104,10 +111,13 @@ let cfg = config.services.xserver.synaptics; in
           Option "MinSpeed" "${cfg.minSpeed}"
           Option "MaxSpeed" "${cfg.maxSpeed}"
           Option "AccelFactor" "${cfg.accelFactor}"
-          Option "TapButton1" "${if cfg.tapButtons then "1" else "0"}"
-          Option "TapButton2" "${if cfg.tapButtons then "2" else "0"}"
-          Option "TapButton3" "${if cfg.tapButtons then "3" else "0"}"
           ${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}"
+          Option "ClickFinger1" "${builtins.elemAt cfg.buttonsMap 0}"
+          Option "ClickFinger2" "${builtins.elemAt cfg.buttonsMap 1}"
+          Option "ClickFinger3" "${builtins.elemAt cfg.buttonsMap 2}"
           Option "VertTwoFingerScroll" "${if cfg.twoFingerScroll then "1" else "0"}"
           Option "HorizTwoFingerScroll" "${if cfg.twoFingerScroll then "1" else "0"}"
           Option "VertEdgeScroll" "${if cfg.vertEdgeScroll then "1" else "0"}"