Setting up MX Master mouse on Linux

Michael Verschoof
3 min readSep 7, 2022

Quite a few people have bought a Logitech MX Master mouse and have difficulties setting it up on a Linux machine. I tried to do this on several occasions and found the online manuals to be fairly confusing, so I tried to write a simpler version here.

In this manual we’ll be using Logiops as I found it takes the least amount of effort.

This manual describes the steps to take when using a Debian/Ubuntu version of Linux. At the time of writing I’m on Ubuntu 22.04 LTS. The mouse I’m using is a MX Master 2S.

Install dependencies

Several libraries need to be installed on your system in order to run Logiops. Run the following command in a terminal window to install them:

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

Clone and build the project

Next step is to download the Logiops project and build it.

Cloning the project

First, we will download the git repository. Make sure that you perform this command inside a directory where you want the project to be downloaded to.

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

Building the project

After the project has been cloned we’ll go to the directory, create a new directory for the build and actually build the project. In order to do so you need to execute the following commands (one by one).

cd logiops
mkdir build
cd build
cmake ..
make

If you get an error like No CMAKE_CXX_COMPILER could be found when running the cmake .. command, run the below command and then try again.

sudo apt-get update && sudo apt-get install build-essential

Creating the config file

We have to tell the Logiops application what each button does. For this we will create a file containing configuration for your mouse. Create a file called logid.cfg in /etc/ and fill it with the following.

devices: (
{
// For the 3S, the name is changed to "MX Master 3S"
name: "Wireless Mouse MX Master 2S";
smartshift:
{
on: true;
threshold: 20;
};
hiresscroll:
{
hires: false;
invert: false;
target: false;
};
dpi: 1750;
buttons: (
{
# Thumb button
cid: 0xc3;
action =
{
type: "Gestures";
gestures: (
{
direction: "Up";
mode: "OnRelease";
action =
{
type: "Keypress";
keys: ["KEY_VOLUMEUP"];
};
},
{
direction: "Down";
mode: "OnRelease";
action =
{
type: "Keypress";
keys: ["KEY_VOLUMEDOWN"];
};
},
{
direction: "Left";
mode: "OnRelease";
action =
{
type: "Keypress";
keys: ["KEY_PREVIOUSSONG"];
};
},
{
direction: "Right";
mode: "OnRelease";
action =
{
type: "Keypress";
keys: ["KEY_NEXTSONG"];
}
},
{
direction: "None";
mode: "OnRelease";
action =
{
type: "Keypress";
keys: ["KEY_PLAYPAUSE"];
}
}
);
};
},
{
# Button behind the scroll
cid: 0xc4;
action =
{
type = "ToggleSmartshift";
};
},
{
# Back button: Previous workspace
cid: 0x53;
action =
{
type: "Keypress";
keys: ["KEY_LEFTMETA", "KEY_PAGEUP"];
};
},
{
# Next button: Next workspace
cid: 0x56;
action =
{
type: "Keypress";
keys: ["KEY_LEFTMETA", "KEY_PAGEDOWN"];
};
});
});

Starting Logiops

Once the above steps have all been completed the only thing remaining is to actually start the daemon by using the following commands.

sudo make install
sudo systemctl enable --now logid

This command starts up the application directly by using the --now flag and makes sure it is started every time you log into your machine.

Done

That’s it! Enjoy your MX Master on your Linux machine!

In some cases (including mine) the back and forward buttons didn’t work at first. After a lot of trial and error I found out that rebooting the machine somehow worked.

Known issues

As some of the replies on this story have mentioned, it might be that an error is shown regarding a missing library. This is depending on your setup, operating system, etc.

In this case you can perform the following command which should resolve the issue:

sudo apt-get install libglib2.0-dev

--

--

Michael Verschoof

Ex-Java developer turned Javascript / Typescript and Vue developer at BTC Direct Europe B.V.