I was a Windows user until very recently, when I decided to switch to some Linux distribution as my daily driver. I chose Zorin OS 16 Pro, primarily because – (1) it is based on Ubuntu, which I have been using on my Raspberry Pi 4 for a while (2) it comes with pre-installed apps (which saved me a couple of hours). I was reluctant to switch because Linux does not support Adobe CC out of the box and it does not support Logitech Options.

I have an MX Master 3, which is very close to my heart. It is one of the finest mice that I’ve ever had, and it feels really nice. Although I do not use all the MX Master 3 buttons and gestures, I still wanted to be able to configure SmartShift and DPI. Fortunately, LogiOps functions more or less like Logitech Options, albeit all on command line.

Installing LogiOps

Fire your terminal (of course) install dependencies

sudo apt install cmake libevdev-dev libudev-dev libconfig++-dev 

After this, you need to clone the LogiOps GitHub repo

git clone https://github.com/PixlOne/logiops.git

Next, you need to build the source. You can refer to this link for that.

Once you’re done with building the project, to install, run

sudo make install

Enable and start the daemon by running the following command

sudo systemctl enable --now logid

You should be able to run logid by running

sudo logid

The output should look something like this:

[WARN] Error adding device /dev/hidraw2: std::exception
[INFO] Detected receiver at /dev/hidraw1
[WARN] Error adding device /dev/hidraw5: std::exception
[INFO] Detected receiver at /dev/hidraw4
[WARN] Error adding device /dev/hidraw4: No DJ reports
[INFO] Device found: Wireless Mouse MX Master 3 on /dev/hidraw1:1

Configuring

The configuration file resides in – /etc/logid.cfg. If it does not exist, you can simply create it by touch logid.cfg.

Open the logid.cfg and paste the contents from this GitHub Gist.

// Logiops (Linux driver) configuration for Logitech MX Master 3.
// Includes gestures, smartshift, DPI.
// Tested on logid v0.2.3 - GNOME 3.38.4 on Zorin OS 16 Pro
// What's working:
//   1. Window snapping using Gesture button (Thumb)
//   2. Forward Back Buttons
//   3. Top button (Ratchet-Free wheel)
// What's not working:
//   1. Thumb scroll (H-scroll)
//   2. Scroll button

// File location: /etc/logid.cfg

devices: ({
  name: "Wireless Mouse MX Master 3";

  smartshift: {
    on: true;
    threshold: 15;
  };

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

  dpi: 1500; // max=4000

  buttons: (
    // Forward button
    {
      cid: 0x56;
      action = {
        type: "Gestures";
        gestures: (
          {
            direction: "None";
            mode: "OnRelease";
            action = {
              type: "Keypress";
              keys: [ "KEY_FORWARD" ];
            }
          },

          {
            direction: "Up";
            mode: "OnRelease";
            action = {
              type: "Keypress";
              keys: [ "KEY_PLAYPAUSE" ];
            }
          },

          {
            direction: "Down";
            mode: "OnRelease";
            action = {
              type: "Keypress";
              keys: [ "KEY_LEFTMETA" ];
            }
          },

          {
            direction: "Right";
            mode: "OnRelease";
            action = {
              type: "Keypress";
              keys: [ "KEY_NEXTSONG" ];
            }
          },

          {
            direction: "Left";
            mode: "OnRelease";
            action = {
              type: "Keypress";
              keys: [ "KEY_PREVIOUSSONG" ];
            }
          }
        );
      };
    },

    // Back button
    {
      cid: 0x53;
      action = {
        type: "Gestures";
        gestures: (
          {
            direction: "None";
            mode: "OnRelease";
            action = {
              type: "Keypress";
              keys: [ "KEY_BACK" ];
            }
          }
        );
      };
    },

    // Gesture button (hold and move)
    {
      cid: 0xc3;
      action = {
        type: "Gestures";
        gestures: (
          {
            direction: "None";
            mode: "OnRelease";
            action = {
              type: "Keypress";
              keys: [ "KEY_LEFTMETA" ]; // open activities overview
            }
          },

          {
            direction: "Right";
            mode: "OnRelease";
            action = {
              type: "Keypress";
              keys: [ "KEY_LEFTMETA", "KEY_RIGHT" ]; // snap window to right
            }
          },

          {
            direction: "Left";
            mode: "OnRelease";
            action = {
              type: "Keypress";
              keys: [ "KEY_LEFTMETA", "KEY_LEFT" ];
            }
		  },

		  {
            direction: "Up";
            mode: "onRelease";
            action = {
              type: "Keypress";
              keys: [ "KEY_LEFTMETA", "KEY_UP" ]; // maximize window
            }
		  },
		  
		  {
            direction: "Down";
            mode: "OnRelease";
            action = {
              type: "Keypress";
              keys: [ "KEY_LEFTMETA", "KEY_DOWN" ]; // minimize window
            }
          }
        );
      };
    },
	
    // Top button
    {
      cid: 0xc4;
      action = {
        type: "Gestures";
        gestures: (
          {
            direction: "None";
            mode: "OnRelease";
            action = {
              type: "ToggleSmartShift";
            }
          },

          {
            direction: "Up";
            mode: "OnRelease";
            action = {
              type: "ChangeDPI";
              inc: 1000,
            }
          },

          {
            direction: "Down";
            mode: "OnRelease";
            action = {
              type: "ChangeDPI";
              inc: -1000,
            }
          }
        );
      };
    }
  );
});

This configuration will set the DPI to 1500 and SmartShift sensitivity to 15.

Key Bindings and Actions

ButtonActionPerforms
Mode Shift ButtonPressSwitch between Ratchet and Free Scroll mode
Mode Shift Button Hold + Swipe UpIncrease the DPI by 1000
Mode Shift ButtonHold + Swipe DownDecrease the DPI by 1000
Gesture ButtonPressActivities Overview
Gesture ButtonHold + Swipe RightSnap the window to right
Gesture ButtonHold + Swipe LeftSnap the window to left
Gesture ButtonHold + Swipe DownMinimize the window
Gesture ButtonHold + Swipe UpMaximize the window
Back ButtonPressGo Back
Forward ButtonPress Go Forward
Forward ButtonHold + Swipe UpPlay/Pause Media
Forward ButtonHold + Swipe DownSuper/Windows Key
Forward ButtonHold + Swipe RightNext Song
Forward ButtonHold + Swipe LeftPrevious Song
Configurations
LogiOps MX Master 3 Configuration
Logitech MX Master 3 Keys (Source – Magnetic Mag

For more information on configuration, you may refer to this wiki. To learn more about the Linux Event Codes, like KEY_LEFTMETA, check out this link.

Conclusion

There are two things that won’t work with this logid.cfg:

  1. The thumb scroll wheel (useful for switching between tabs)
  2. Scroll press (I personally use it to emulate Ctrl + B in VS Code)

It would be nice to have Logitech Options on Linux since the product information shows that it is ‘compatible’ with Linux, Windows, and Mac. Logitech Options lets you choose app-specific settings which is something that I miss very much, but while developers at Logitech work on Logitech Options for Linux (hoping that they are) LogiOps is the best tool we have to configure most of its functionality.