backwards: Add a raw touchpad bridge for the K400 Plus
The K400 Plus firmware turns two-finger swipes into whole wheel ticks, so every scroll jumps a fixed distance. A trimmed copy of k400-raw's touchpad mode switches the touchpad to raw HID++ reporting and exposes it as a native multitouch touchpad, which GNOME scrolls smoothly.
This commit is contained in:
1 parent
0d1e7d4c77
commit
b4b9136593
2 files changed
+691
No files matched your search
@@ -0,0 +1,43 @@
|
||||
{ lib, pkgs, ... }:
|
||||
let
|
||||
py = pkgs.python3Packages;
|
||||
in
|
||||
{
|
||||
# The K400 Plus firmware turns two-finger swipes into coarse wheel ticks.
|
||||
# This switches its touchpad to raw HID++ reporting and exposes it as a
|
||||
# native multitouch touchpad, so GNOME scrolls it smoothly.
|
||||
systemd.services.k400-touchpad = {
|
||||
description = "Logitech K400 Plus raw touchpad bridge";
|
||||
wants = [ "systemd-udevd.service" ];
|
||||
after = [ "systemd-udevd.service" ];
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
|
||||
environment = {
|
||||
# `toPythonModule` exposes Solaar's `logitech_receiver`. Not a
|
||||
# `withPackages` env, since Solaar bundles a conflicting `hid_parser`.
|
||||
PYTHONPATH = py.makePythonPath [
|
||||
(py.toPythonModule pkgs.solaar)
|
||||
py.evdev
|
||||
py.pygobject3
|
||||
];
|
||||
|
||||
# `logitech_receiver` imports Gdk at load time
|
||||
GI_TYPELIB_PATH = lib.makeSearchPath "lib/girepository-1.0" [
|
||||
pkgs.gtk3
|
||||
pkgs.pango.out
|
||||
pkgs.gdk-pixbuf
|
||||
pkgs.harfbuzz
|
||||
pkgs.gobject-introspection
|
||||
];
|
||||
};
|
||||
|
||||
serviceConfig = {
|
||||
ExecStart = "${py.python.interpreter} ${./k400-touchpad.py}";
|
||||
Restart = "on-failure";
|
||||
RestartSec = 3;
|
||||
TimeoutStopSec = 8;
|
||||
};
|
||||
};
|
||||
|
||||
boot.kernelModules = [ "uinput" ];
|
||||
}
|
||||
Reference in new issue
Block a user