tangled
alpha
login
or
join now
pyrox.dev
/
nixpkgs
0
fork
atom
lol
0
fork
atom
overview
issues
pulls
pipelines
Trackpoint scrolling on T450s et al
Aristid Breitkreuz
11 years ago
4835763e
d7de6dad
+31
-17
1 changed file
expand all
collapse all
unified
split
nixos
modules
tasks
trackpoint.nix
+31
-17
nixos/modules/tasks/trackpoint.nix
···
45
45
'';
46
46
};
47
47
48
48
+
fakeButtons = mkOption {
49
49
+
default = false;
50
50
+
type = types.bool;
51
51
+
description = ''
52
52
+
Switch to "bare" PS/2 mouse support in case Trackpoint buttons are not recognized
53
53
+
properly. This can happen for example on models like the L430, T450, T450s, on
54
54
+
which the Trackpoint buttons are actually a part of the Synaptics touchpad.
55
55
+
'';
56
56
+
};
57
57
+
48
58
};
49
59
50
60
};
···
52
62
53
63
###### implementation
54
64
55
55
-
config = mkMerge [
56
56
-
(mkIf config.hardware.trackpoint.enable {
65
65
+
config =
66
66
+
let cfg = config.hardware.trackpoint; in
67
67
+
mkMerge [
68
68
+
(mkIf cfg.enable {
57
69
services.udev.extraRules =
58
70
''
59
59
-
ACTION=="add|change", SUBSYSTEM=="input", ATTR{name}=="TPPS/2 IBM TrackPoint", ATTR{device/speed}="${toString config.hardware.trackpoint.speed}", ATTR{device/sensitivity}="${toString config.hardware.trackpoint.sensitivity}"
71
71
+
ACTION=="add|change", SUBSYSTEM=="input", ATTR{name}=="TPPS/2 IBM TrackPoint", ATTR{device/speed}="${toString cfg.speed}", ATTR{device/sensitivity}="${toString cfg.sensitivity}"
60
72
'';
61
73
62
74
system.activationScripts.trackpoint =
···
65
77
'';
66
78
})
67
79
68
68
-
(mkIf config.hardware.trackpoint.emulateWheel {
69
69
-
services.xserver.config =
70
70
-
''
71
71
-
Section "InputClass"
72
72
-
Identifier "Trackpoint Wheel Emulation"
73
73
-
MatchProduct "Elantech PS/2 TrackPoint|TPPS/2 IBM TrackPoint|DualPoint Stick|Synaptics Inc. Composite TouchPad / TrackPoint|ThinkPad USB Keyboard with TrackPoint|USB Trackpoint pointing device|Composite TouchPad / TrackPoint"
74
74
-
MatchDevicePath "/dev/input/event*"
75
75
-
Option "EmulateWheel" "true"
76
76
-
Option "EmulateWheelButton" "2"
77
77
-
Option "Emulate3Buttons" "false"
78
78
-
Option "XAxisMapping" "6 7"
79
79
-
Option "YAxisMapping" "4 5"
80
80
-
EndSection
81
81
-
'';
80
80
+
(mkIf (cfg.emulateWheel) {
81
81
+
services.xserver.inputClassSections =
82
82
+
[''
83
83
+
Identifier "Trackpoint Wheel Emulation"
84
84
+
MatchProduct "${if cfg.fakeButtons then "PS/2 Generic Mouse" else "Elantech PS/2 TrackPoint|TPPS/2 IBM TrackPoint|DualPoint Stick|Synaptics Inc. Composite TouchPad / TrackPoint|ThinkPad USB Keyboard with TrackPoint|USB Trackpoint pointing device|Composite TouchPad / TrackPoint"}"
85
85
+
MatchDevicePath "/dev/input/event*"
86
86
+
Option "EmulateWheel" "true"
87
87
+
Option "EmulateWheelButton" "2"
88
88
+
Option "Emulate3Buttons" "false"
89
89
+
Option "XAxisMapping" "6 7"
90
90
+
Option "YAxisMapping" "4 5"
91
91
+
''];
92
92
+
})
93
93
+
94
94
+
(mkIf cfg.fakeButtons {
95
95
+
boot.extraModprobeConfig = "options psmouse proto=bare";
82
96
})
83
97
];
84
98
}