Francisco Jiménez Cabrera
Francisco Jiménez Cabrera I have always been interested in computer and technology scene. Currently, I spend my days working as a web developer at Canonical.

Logitech MX Master on Linux

Logitech MX Master on Linux

The basic functionality of the mouse should work with no particular configuration if using the unified receiver USB dongle. However, I miss the gestures of pressing my thumb and moving the mouse.

The mouse exists in 3 versions:

  • Mx Master.
  • Mx Master 2s.
  • Mx Master 3.

The functionalities are the same in all three, I have the 2S, so one part of this guide will focus on this one.

logiops

logiops is an unofficial driver for Logitech mice and keyboards. The source code can be found in their GitHub repo.

Installation

For Debian/Ubuntu systems, first get all the needed dependencies: sudo apt install cmake libevdev-dev libudev-dev libconfig++-dev.

Clone the repo:git clone https://github.com/PixlOne/logiops.git

Compile it:

1
2
3
4
mkdir build
cd build
cmake ..
make

And install it:

1
2
sudo make install
sudo systemctl enable --now logid

Configuration

To enable the thumb gestures, we need to use a particular configuration. This one is for the Master MX 2S. Feel free to do any modifications:

This configuration needs to be save on /etc/logid.cfg:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
devices: ({
  name: "Wireless Mouse MX Master 2S";

  // A lower threshold number makes the wheel switch to free-spin mode
  // quicker when scrolling fast.
  smartshift: {
    on: true;threshold: 15;
  };

  hiresscroll: {
    hires: true;invert: false;target: false;
  };

  // Higher numbers make the mouse more sensitive (cursor moves faster),
  // 4000 max for MX Master 3.
  dpi: 1000;

  buttons: (
    // Modify top button on the mouse, it could support gestures as well.
    // { cid: 0xc4; action = { type: "Keypress"; keys: ["BTN_BACK"];    }; },

    // Enable thumb gestures
    {
      cid: 0xc3;
      action = {
        type: "Gestures";
        gestures: ({
          direction: "Left";
          mode: "OnRelease";
          action = {
            type: "Keypress";
            keys: ["KEY_LEFTMETA", "KEY_COMMA"];
          };
        }, {
          direction: "Right";
          mode: "OnRelease";
          action = {
            type: "Keypress";
            keys: ["KEY_LEFTMETA", "KEY_DOT"];
          };
        }, {
          direction: "None";
          mode: "OnRelease";
          action = {
            type: "Keypress";
            keys: ["KEY_LEFTMETA"]
          };
        });
      };
    }
  );
});

As you can see, the gestures will be equivalent to pressing specific keys on my keyboard. In this case, I did it for my PaperWM keymaps.

Now we need to restart the service with sudo systemctl restart logid and done!

Enjoyed this article? Support my work!

If you found this content helpful, consider buying me a coffee to show your appreciation.

Buy me a coffee