From 4598ff3bb844d34125da38e1ea3138ca461449c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dav=C3=AD=C3=B0=20Steinn=20Geirsson?= Date: Tue, 7 Sep 2021 15:55:01 +0000 Subject: [PATCH] nixos/libinput: Add transformation matrix option --- nixos/modules/services/x11/hardware/libinput.nix | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/nixos/modules/services/x11/hardware/libinput.nix b/nixos/modules/services/x11/hardware/libinput.nix index 439708bc47ed..e2fb7d0918e3 100644 --- a/nixos/modules/services/x11/hardware/libinput.nix +++ b/nixos/modules/services/x11/hardware/libinput.nix @@ -163,6 +163,15 @@ let cfg = config.services.xserver.libinput; ''; }; + transformationMatrix = mkOption { + type = types.nullOr types.str; + default = null; + description = '' + A string of 9 space-separated floating point numbers. Sets the transformation matrix to + the 3x3 matrix where the first row is (abc), the second row is (def) and the third row is (ghi). + ''; + }; + disableWhileTyping = mkOption { type = types.bool; default = false; @@ -196,6 +205,7 @@ let cfg = config.services.xserver.libinput; ${optionalString (cfg.${deviceType}.accelSpeed != null) ''Option "AccelSpeed" "${cfg.${deviceType}.accelSpeed}"''} ${optionalString (cfg.${deviceType}.buttonMapping != null) ''Option "ButtonMapping" "${cfg.${deviceType}.buttonMapping}"''} ${optionalString (cfg.${deviceType}.calibrationMatrix != null) ''Option "CalibrationMatrix" "${cfg.${deviceType}.calibrationMatrix}"''} + ${optionalString (cfg.${deviceType}.transformationMatrix != null) ''Option "TransformationMatrix" "${cfg.${deviceType}.transformationMatrix}"''} ${optionalString (cfg.${deviceType}.clickMethod != null) ''Option "ClickMethod" "${cfg.${deviceType}.clickMethod}"''} Option "LeftHanded" "${xorgBool cfg.${deviceType}.leftHanded}" Option "MiddleEmulation" "${xorgBool cfg.${deviceType}.middleEmulation}" @@ -227,6 +237,7 @@ in { "sendEventsMode" "tapping" "tappingDragLock" + "transformationMatrix" "disableWhileTyping" "additionalOptions" ]);