Configuring Logitech mouse using Solaar

I am using Logitech MX Master 3S mouse. It has quite a lot of buttons and extra horizontal wheel which can be configured for extra actions.

I decided to use Solaar. Potential alternatives: piper and logiops.

Useful documentation for configuring Logitech MX Master mouses at Arch Wiki

Installing Solaar on NixOS

NixOS is a Linux distribution which is configured using Nix language.

  1. Add solaar to environment.systemPackages
  2. Set hardware.logitech.wireless.enable = true; which will enable udev rules needed for Solaar.
  3. Restart udev rules using
sudo udevadm control --reload
sudo udevadm trigger

I also symlink Solaar rules in my configuration repository to ~/.config/solaar/rules.yaml using home-manager. That allows to share the same configuration across multiple computers.

Configuring Solaar rules

  1. Launch Solaar and make sure that you see your mouse settings /img/solaar.png
  2. Enable Key/Button Diversion -> Mouse Gesture Button -> Mouse Gestures
  3. Rules can be edited with Rule Editor /img/solaar-rules.png
  • details are displayed after selecting a rule
  • to add new rules use menu after right-clicking
  1. Gestures are started with Gesture Button which is on the button of the mouse and clicked with a thumb.
  • For example clicking Gesture Button and then moving to the right will trigger Super+Right which on my desktop moves to right window/workspace.
  1. Rules can be also edited in ~/.config/solaar/rules.yaml file.
  2. Example config which enables mouse gestures in each direction and forward/back buttons for copying and pasting.
%YAML 1.3
---
- Rule:
  - MouseGesture: Mouse Right
  - KeyPress:
    - [Super_L, Right]
    - click
- Rule:
  - MouseGesture: Mouse Left
  - KeyPress:
    - [Super_L, Left]
    - click
- Rule:
  - MouseGesture: Mouse Up
  - KeyPress:
    - [Super_L, w]
    - click
- Rule:
  - MouseGesture: Mouse Down
  - KeyPress:
    - [Super_L, a]
    - click
...
---
- Rule:
  - Key: [Forward Button, pressed]
  - KeyPress:
    - [Control_L, c]
    - click
...
---
- Rule:
  - Key: [Back Button, pressed]
  - KeyPress:
    - [Control_L, v]
    - click
...