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`
|
|
|
|
# for the `ScrollMethod` configuration to not be overriden
|
|
|
|
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"
|
|
|
|
''
|
|
|
|
];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|