2021-06-03 18:10:37 +02:00
|
|
|
# Hold down the `next page` button to scroll using the ball
|
|
|
|
{ config, lib, ... }:
|
|
|
|
let
|
2024-02-06 16:08:16 +01:00
|
|
|
cfg = config.my.hardware.trackball;
|
2021-06-03 18:10:37 +02:00
|
|
|
in
|
|
|
|
{
|
2024-02-06 16:08:16 +01:00
|
|
|
options.my.hardware.trackball = with lib; {
|
|
|
|
enable = mkEnableOption "trackball configuration";
|
2021-06-03 18:10:37 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
config = lib.mkIf cfg.enable {
|
|
|
|
services.xserver = {
|
|
|
|
# This section must be *after* the one configured by `libinput`
|
2024-09-27 15:48:26 +02:00
|
|
|
# for the `ScrollMethod` configuration to not be overridden
|
2021-06-03 18:10:37 +02:00
|
|
|
inputClassSections = lib.mkAfter [
|
2024-02-06 16:08:16 +01:00
|
|
|
# MX Ergo
|
2021-06-03 18:10:37 +02:00
|
|
|
''
|
|
|
|
Identifier "MX Ergo scroll button configuration"
|
|
|
|
MatchProduct "MX Ergo"
|
|
|
|
MatchIsPointer "on"
|
|
|
|
Option "ScrollMethod" "button"
|
|
|
|
Option "ScrollButton" "9"
|
|
|
|
''
|
|
|
|
];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|