modules: hardware: add mx-ergo

This adds the ability to scroll using the ball, which is way better.
This commit is contained in:
Bruno BELANYI 2021-06-03 18:10:37 +02:00
parent e7723d5275
commit a5d63dcf65
2 changed files with 27 additions and 0 deletions

View File

@ -5,6 +5,7 @@
imports = [
./bluetooth.nix
./ergodox.nix
./mx-ergo.nix
./networking.nix
./sound.nix
./upower.nix

View File

@ -0,0 +1,26 @@
# Hold down the `next page` button to scroll using the ball
{ config, lib, ... }:
let
cfg = config.my.hardware.mx-ergo;
in
{
options.my.hardware.mx-ergo = with lib; {
enable = mkEnableOption "MX Ergo configuration";
};
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 [
''
Identifier "MX Ergo scroll button configuration"
MatchProduct "MX Ergo"
MatchIsPointer "on"
Option "ScrollMethod" "button"
Option "ScrollButton" "9"
''
];
};
};
}