mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-02 15:41:48 +00:00
Merge pull request #4746 from abbradar/synaptics-fingers
Add "fingersMap" option to Synaptics
This commit is contained in:
commit
e18e77fbcd
@ -25,12 +25,14 @@ in {
|
|||||||
services.xserver.synaptics = {
|
services.xserver.synaptics = {
|
||||||
|
|
||||||
enable = mkOption {
|
enable = mkOption {
|
||||||
|
type = types.bool;
|
||||||
default = false;
|
default = false;
|
||||||
example = true;
|
example = true;
|
||||||
description = "Whether to enable touchpad support.";
|
description = "Whether to enable touchpad support.";
|
||||||
};
|
};
|
||||||
|
|
||||||
dev = mkOption {
|
dev = mkOption {
|
||||||
|
type = types.nullOr types.str;
|
||||||
default = null;
|
default = null;
|
||||||
example = "/dev/input/event0";
|
example = "/dev/input/event0";
|
||||||
description =
|
description =
|
||||||
@ -59,41 +61,56 @@ in {
|
|||||||
};
|
};
|
||||||
|
|
||||||
twoFingerScroll = mkOption {
|
twoFingerScroll = mkOption {
|
||||||
|
type = types.bool;
|
||||||
default = false;
|
default = false;
|
||||||
description = "Whether to enable two-finger drag-scrolling.";
|
description = "Whether to enable two-finger drag-scrolling.";
|
||||||
};
|
};
|
||||||
|
|
||||||
vertEdgeScroll = mkOption {
|
vertEdgeScroll = mkOption {
|
||||||
|
type = types.bool;
|
||||||
default = ! cfg.twoFingerScroll;
|
default = ! cfg.twoFingerScroll;
|
||||||
description = "Whether to enable vertical edge drag-scrolling.";
|
description = "Whether to enable vertical edge drag-scrolling.";
|
||||||
};
|
};
|
||||||
|
|
||||||
tapButtons = mkOption {
|
tapButtons = mkOption {
|
||||||
|
type = types.bool;
|
||||||
default = true;
|
default = true;
|
||||||
example = false;
|
example = false;
|
||||||
description = "Whether to enable tap buttons.";
|
description = "Whether to enable tap buttons.";
|
||||||
};
|
};
|
||||||
|
|
||||||
buttonsMap = mkOption {
|
buttonsMap = mkOption {
|
||||||
|
type = types.listOf types.int;
|
||||||
default = [1 2 3];
|
default = [1 2 3];
|
||||||
example = [1 3 2];
|
example = [1 3 2];
|
||||||
description = "Remap touchpad buttons.";
|
description = "Remap touchpad buttons.";
|
||||||
apply = map toString;
|
apply = map toString;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
fingersMap = mkOption {
|
||||||
|
type = types.listOf types.int;
|
||||||
|
default = [1 2 3];
|
||||||
|
example = [1 3 2];
|
||||||
|
description = "Remap several-fingers taps.";
|
||||||
|
apply = map toString;
|
||||||
|
};
|
||||||
|
|
||||||
palmDetect = mkOption {
|
palmDetect = mkOption {
|
||||||
|
type = types.bool;
|
||||||
default = false;
|
default = false;
|
||||||
example = true;
|
example = true;
|
||||||
description = "Whether to enable palm detection (hardware support required)";
|
description = "Whether to enable palm detection (hardware support required)";
|
||||||
};
|
};
|
||||||
|
|
||||||
horizontalScroll = mkOption {
|
horizontalScroll = mkOption {
|
||||||
|
type = types.bool;
|
||||||
default = true;
|
default = true;
|
||||||
example = false;
|
example = false;
|
||||||
description = "Whether to enable horizontal scrolling (on touchpad)";
|
description = "Whether to enable horizontal scrolling (on touchpad)";
|
||||||
};
|
};
|
||||||
|
|
||||||
additionalOptions = mkOption {
|
additionalOptions = mkOption {
|
||||||
|
type = types.str;
|
||||||
default = "";
|
default = "";
|
||||||
example = ''
|
example = ''
|
||||||
Option "RTCornerButton" "2"
|
Option "RTCornerButton" "2"
|
||||||
@ -130,6 +147,9 @@ in {
|
|||||||
Option "ClickFinger1" "${builtins.elemAt cfg.buttonsMap 0}"
|
Option "ClickFinger1" "${builtins.elemAt cfg.buttonsMap 0}"
|
||||||
Option "ClickFinger2" "${builtins.elemAt cfg.buttonsMap 1}"
|
Option "ClickFinger2" "${builtins.elemAt cfg.buttonsMap 1}"
|
||||||
Option "ClickFinger3" "${builtins.elemAt cfg.buttonsMap 2}"
|
Option "ClickFinger3" "${builtins.elemAt cfg.buttonsMap 2}"
|
||||||
|
Option "TapButton1" "${builtins.elemAt cfg.fingersMap 0}"
|
||||||
|
Option "TapButton2" "${builtins.elemAt cfg.fingersMap 1}"
|
||||||
|
Option "TapButton3" "${builtins.elemAt cfg.fingersMap 2}"
|
||||||
Option "VertTwoFingerScroll" "${if cfg.twoFingerScroll then "1" else "0"}"
|
Option "VertTwoFingerScroll" "${if cfg.twoFingerScroll then "1" else "0"}"
|
||||||
Option "HorizTwoFingerScroll" "${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"}"
|
Option "VertEdgeScroll" "${if cfg.vertEdgeScroll then "1" else "0"}"
|
||||||
|
Loading…
Reference in New Issue
Block a user