New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
trackpoint: Make the device name configurable #44058
trackpoint: Make the device name configurable #44058
Conversation
8a0b3ec
to
f802230
Compare
nixos/modules/tasks/trackpoint.nix
Outdated
''; | ||
}) | ||
|
||
(mkIf (cfg.emulateWheel) { | ||
services.xserver.inputClassSections = | ||
['' | ||
Identifier "Trackpoint Wheel Emulation" | ||
MatchProduct "${if cfg.fakeButtons then "PS/2 Generic Mouse" else "ETPS/2 Elantech TrackPoint|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"}" | ||
MatchProduct "${if cfg.fakeButtons then "PS/2 Generic Mouse" else "ETPS/2 Elantech TrackPoint|Elantech PS/2 TrackPoint|${cfg.device}|DualPoint Stick|Synaptics Inc. Composite TouchPad / TrackPoint|ThinkPad USB Keyboard with TrackPoint|USB Trackpoint pointing device|Composite TouchPad / TrackPoint"}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's up with this list of device names? And why is only the TPPS/2 IBM TrackPoint
in the udev rules above?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking through the commit history, the udev rules existed first and this section was added with the config from thinkwiki. Afterwards people added their devices to the xorg config.
IMHO the list here is not necessary and just configuring the device would be nicer, but I wouldn't want to break existing configurations.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm alright, but then I think it would make more sense to append cfg.device to this list instead of replacing the previously fixed entry. Then the old entry will surely always still be there, which makes sense, because it's compatible, even if cfg.device is set differently.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't think it would matter, if somebody uses that device they wouldn't change the cfg but I'll change it so that I append it, it can't hurt :)
f802230
to
c84ed9e
Compare
nixos/modules/tasks/trackpoint.nix
Outdated
@@ -55,6 +55,15 @@ with lib; | |||
''; | |||
}; | |||
|
|||
device = mkOption { | |||
default = "TPPS/2 IBM TrackPoint"; | |||
type = types.string; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh and I almost missed this, types.str
is preferred over types.string
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops, sorry. Fixed.
nixos/modules/tasks/trackpoint.nix
Outdated
type = types.string; | ||
description = '' | ||
The device name of the trackpoint. You can check with xinput. | ||
Some newer devices (example x1c6) use "TPPS/2 Elan TrackPoint"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And here it should be a "." at the end.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Forgot to check that, sorry. Nice catch. Fixed.
c84ed9e
to
081cf4b
Compare
nixos/modules/tasks/trackpoint.nix
Outdated
type = types.str; | ||
description = '' | ||
The device name of the trackpoint. You can check with xinput. | ||
Some newer devices (example x1c6) use "TPPS/2 Elan TrackPoint."; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Umm, I meant like ...(example x1c6) use "TPPS/2 Elan TrackPoint".
:)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤦♂️
I fixed it now, I also removed the ;
081cf4b
to
0ef3119
Compare
Motivation for this change
Allow usage of trackpoint configuration with other devices instead of hardcoding the name.
Things done
sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)nix path-info -S
before and after)