mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-01 15:11:25 +00:00
Use a udev rule for trackpoint configuration
This commit is contained in:
parent
49e6ef2a19
commit
6fe59796b2
@ -46,28 +46,10 @@ with lib;
|
||||
|
||||
config = mkIf config.hardware.trackpoint.enable {
|
||||
|
||||
jobs.trackpoint =
|
||||
{ description = "Initialize trackpoint";
|
||||
|
||||
startOn = "started udev";
|
||||
|
||||
task = true;
|
||||
|
||||
script = ''
|
||||
for directory in /sys/devices/platform/i8042/serio1 \
|
||||
/sys/devices/platform/i8042/serio1/serio2 \
|
||||
/sys/devices/platform/i8042/serio4/serio5; do
|
||||
if [ -e "$directory/speed" ]; then
|
||||
echo -n ${toString config.hardware.trackpoint.speed} \
|
||||
> "$directory/speed"
|
||||
echo -n ${toString config.hardware.trackpoint.sensitivity} \
|
||||
> "$directory/sensitivity"
|
||||
break
|
||||
fi
|
||||
done
|
||||
'';
|
||||
};
|
||||
|
||||
services.udev.extraRules =
|
||||
''
|
||||
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}"
|
||||
'';
|
||||
};
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user