Lucas Zuege's Blog

Using LogiOps to configure the MX Master 3 on Linux

For over a year now, I have owned the Logitech MX Master 3 mouse.

Utilizing the mouse on my work laptop, I have zero issues, as it runs Windows and I have the Logitech Options+ software installed.

However, when I am on Linux, I lose a decent amount of the features, mainly the thumb-button gestures. As someone who recently started to utilize VMware Horizon for accessing a work Virtual Desktop, having the ability to switch between Gnome Workspaces would be amazing. So, I decided to see if I could find a way to configure gestures.

After some research, I discovered LogiOps, an unofficial driver for Logitech peripherals that gives you the option to customize what each button does, including the gesture button!

Since I doubt I am the only one who wants these functionalities on Linux, I felt I should share what I have done to get it installed and configured.

Installing LogiOps

Fedora

As a Fedora user, the easiest way to install LogiOps is by using dnf.

dnf install logiops

Build directly from the repository

You can build LogiOps from the Github repository. First, make sure you have the required dependencies installed - https://github.com/PixlOne/logiops#dependencies.

Arch Linux:

pacman -S cmake libevdev libconfig pkgconf

Debian/Ubuntu:

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

Fedora:

dnf install cmake libevdev-devel systemd-devel libconfig-devel gcc-c++

Gentoo Linux:

emerge dev-libs/libconfig dev-libs/libevdev dev-util/cmake virtual/libudev

Solus:

eopkg install libevdev-devel libconfig-devel libgudev-devel

openSUSE:

zypper install cmake libevdev-devel systemd-devel libconfig-devel gcc-c++ libconfig++-devel libudev-devel

After you have the dependencies installed, you can go ahead and clone the git repository. I would suggest cloning it into your Documents folder, but you can clone it wherever you want.

Once you have a location, open it up in your terminal and run the following...

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

After cloning the repository, go ahead and navigate to the repository.

cd logiops

Now, you will need to build LogiOps.

mkdir build
cd build
cmake ..
make

Sweet! LogiOps has been built. We can go ahead and install it now!

make install

And congrats! You now installed LogiOps by building it yourself from the git repository.

But, we aren't quite done yet.

Enabling LogiOps to start on boot

LogiOps is a great tool, however, it is required to be run for it to apply configurations. The best way to accomplish this is by setting it to run automatically at boot.

This can be accomplished with the following command.

systemctl enable --now logid

This will set the logid service (installed by LogiOps) to start on system boot, as well as start the service right away.

At this point, I also suggest running logid, just to make sure it is correct. Just type logid in your terminal, and press enter. I suggest using sudo as well.

This should automatically detect your Logitech mouse and create a default configuration file.

MX Master 3 Configuration

Now that you have the default configuration file created, go ahead and open the config file located at /etc/logid.cfg.

If it does not exist, feel free to create the file.

With the file open, you are now able to modify it to whatever configurations you want your MX Master 3 to have.

You can learn more about the configurations via - https://github.com/PixlOne/logiops/wiki/Configuration.

Below, you can find my configurations I use. It is focused around key commands in the Gnome Desktop Environment. Other Desktop Environment's may result in different functionality.

Configuration

Button Action What it does
Gesture Button Press Activities Overview
Gesture Button Hold + Swipe Right Move to right Gnome Workspace
Gesture Button Hold + Swipe Left Move to left Gnome Workspace
Gesture Button Hold + Swipe Down Unmaximize the window
Gesture Button Hold + Swipe Up Maximize the window
Mode Shift Button Press Switch between DPI Modes 1000, 2000, 3000, 4000
Mode Shift Button Hold + Swipe Up Increase Volume
Mode Shift Button Hold + Swipe Down Decrease Volume
Mode Shift Button Hold + Swipe Right Increase Brightness
Mode Shift Button Hold + Swipe Left Decrease Brightness
devices: (
{
    name: "Wireless Mouse MX Master 3";
    smartshift:
    {
        on: true;
        threshold: 20;
    };
    hiresscroll:
    {
        hires: true;
        invert: false;
        target: false;
    };
    dpi: 1000;

    buttons: (
    	{ cid: 0xc3; action = 
    		{
                type: "Gestures";
                gestures: (
                    {
                        direction: "Up";
                        mode: "OnFewPixels";
                        pixels: 200;
                        action =
                        {
                            type: "Keypress";
                            keys: ["KEY_LEFTMETA", "KEY_UP"];
                        };
                    },
                    {
                        direction: "Down";
                        mode: "OnFewPixels";
                        pixels: 200;
                        action =
                        {
                            type: "Keypress";
                            keys: ["KEY_LEFTMETA", "KEY_DOWN"];
                        };
                    },
                    {
                        direction: "Right";
                        mode: "OnFewPixels";
                        pixels: 200;
                        action =
                        {
                            type: "Keypress";
                            keys: ["KEY_LEFTCTRL", "KEY_LEFTALT", "KEY_RIGHT"];
                        };
                    },
                    {
                        direction: "Left";
                        mode: "OnFewPixels";
                        pixels: 200;
                        action =
                 		{
                            type: "Keypress";
                            keys: ["KEY_LEFTCTRL", "KEY_LEFTALT", "KEY_LEFT"];
                        };
                    },
                    {
                        direction: "None";
                        mode: "OnRelease";
                        action =
                        {
                        	type: "Keypress";
                        	keys: ["KEY_LEFTMETA"];
                        };
                    }
                );
            };
        },
        { cid: 0xc4; action = 
    		{
                type: "Gestures";
                gestures: (
                    {
                        direction: "Right";
                        mode: "OnFewPixels";
                        pixels: 200;
                        action =
                        {
                            type: "Keypress";
                            keys: ["KEY_BRIGHTNESSUP"];
                        };
                    },
                    {
                        direction: "Left";
                        mode: "OnFewPixels";
                        pixels: 200;
                        action =
                        {
                            type: "Keypress";
                            keys: ["KEY_BRIGHTNESSDOWN"];
                        };
                    },
                    {
                        direction: "Up";
                        mode: "OnFewPixels";
                        pixels: 200;
                        action =
                        {
                            type: "Keypress";
                            keys: ["KEY_VOLUMEUP"];
                        };
                    },
                    {
                        direction: "Down";
                        mode: "OnFewPixels";
                        pixels: 200;
                        action =
                        {
                            type: "Keypress";
                            keys: ["KEY_VOLUMEDOWN"];
                        };
                    },
                    {
                        direction: "None";
                        mode: "OnRelease";
                        action = { type: "CycleDPI"; dpis: [1000, 2000, 3000, 4000];};
                    }
                );
            };
        }
    );
}
);

You can copy and paste the above configurations into your logid.cfg file if you want to copy my configurations. Otherwise, you can modify it or create your own!

Troubleshooting

Below, you can find some of the issues I am aware of, and how to fix them.

- Configurations are not automatically applying on boot

Do you have two Logitech Receivers connected to your computer? I noticed that if you have the Logitech Unifying receiver for the MX Master 3, as well as other receivers, for say a Logitech G305, it will not apply the configurations.

Manually running logid -v in the terminal can apply these configurations, otherwise you will need to disconnect your non-Logitech MX Master 3 receiver and restart the service by running systemctl restart logid.service.

You can also remove your Unifying receiver and connect your MX Master 3 via bluetooth. This has proven to work, and you do not need to remove your other Logitech receiver.

#Guides #Linux