Mouse acceleration

Revision as of 21:58, 21 February 2026 by Phobos (talk | contribs) (Created a page for mouse acceleration, with an example setup for maccel)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Mouse acceleration is an algorithm that increases the distance the cursor travels depending on the speed that the cursor moves, as opposed to a linear movement that always moves the cursor the same amount regardless of speed.

Some desktop environments such as KDE Plasma have the option to enable/disable mouse acceleration in settings. In Xorg it is enabled by default, to configure this behavior see Disabling touchpad and mouse accelerations on the Xorg page.

If you would like to configure mouse acceleration curves on NixOS, an option you may use is maccel.

Maccel

The program maccel is available as a flake. It may be configured declaratively through nix. Find more info on the maccel GitHub and the flake section of the GitHub.

Flake example:

❄︎ flake.nix
{
  inputs.maccel.url = "github:Gnarus-G/maccel";
  # ...

  outputs = {nixpkgs, ...} @ inputs: {
    nixosConfigurations.YOUR_HOSTNAME = nixpkgs.lib.nixosSystem {
      specialArgs = { inherit inputs; }; 
      modules = [
        ./configuration.nix
        # ...
      ];
    };
  };
}

Configuration example:

❄︎ configuration.nix
{inputs, ...}: {
  imports = [
    inputs.maccel.nixosModules.default
  ];

  hardware.maccel = {
    enable = true;
    enableCli = true; # Allows changing parameters through the CLI, session only.
    parameters = {
      # Common (all modes)
      sensMultiplier = 1;
      yxRatio = 1.0;
      inputDpi = 800.0;
      angleRotation = 0.0;
      mode = "synchronous";

      # Linear mode
      acceleration = 0.3;
      offset = 2.0;
      outputCap = 2.0;

      # Natural mode
      #decayRate = 0.1;
      #offset = 2.0;
      #limit = 1.5;

      # Synchronous mode
      #gamma = 1.0;
      #smooth = 0.5;
      #motivity = 2.5;
      #syncSpeed = 10.0;
    };
  };

  # Use CLI/TUI without sudo
  users.groups.maccel.members = ["YOUR_HOSTNAME"];
}

Afterwards you may need to reboot before maccel can take effect.

The CLI may be accessed using:

$ maccel tui