Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save Gusfit1/83f91b0fe1df0141110f209568054058 to your computer and use it in GitHub Desktop.
Save Gusfit1/83f91b0fe1df0141110f209568054058 to your computer and use it in GitHub Desktop.
MX Master 3S logiops configuration

MX Master 3S logiops configuration

Config features:

  • Hi res scroll with free-spin enabled by default
  • Side buttons = Volume
  • Thumb gesture button = Switch between workspaces (hold and drag mouse right/left)
  • Option to use thumb gesture button to switch hosts (commented out)

logiops is an open source project created by (PixlOne) to configure Logi peripherals. It works alongside Solaar, which shows battery life in the system tray and has functions to pair devices with the Logitech Unifying Receiver.

Additional Info:

Installation

Installation instructions for different distributions are available from the developer, but here are the commands for a Pop! OS/Ubuntu workstation (verified with 20.04, 21.10, and 22.04) and Arch (EndeavourOS):

Install dependencies in Pop! OS/Ubuntu:

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

Install dependencies in Arch:

sudo pacman -S base-devel cmake libevdev libconfig systemd-libs glib2

Clone, make, install and start logid.service:

git clone https://github.com/PixlOne/logiops
cd logiops
mkdir build
cd build
cmake ..
make
sudo make install
sudo touch /etc/logid.cfg
sudo systemctl enable --now logid

My /etc/logid.cfg File

devices: (
{
    name: "MX Master 3S";
    smartshift:
    {
        on: false;
        threshold: 30;
        torque: 50;
    };
    hiresscroll:
    {
        hires: true;
        invert: false;
        target: false;
    };
    dpi: 1500;

    buttons: (
        {
            cid: 0xc3;
            action =
            {
                type: "Gestures";
                gestures: (
                    {
                        direction: "Right";
                        mode: "OnRelease";
                        action =
                        {
                            type: "Keypress";
                            keys: ["KEY_LEFTMETA", "KEY_END"];
                        };
                    },
                    {
                        direction: "Left";
                        mode: "OnRelease";
                        action =
                        {
                            type: "Keypress";
                            keys: ["KEY_LEFTMETA", "KEY_HOME"];
                        };
                    }
                );
            };
        },
        {
            cid: 0x56;
            action =
            {
                type: "Keypress";
                keys: ["KEY_VOLUMEUP"];
            };
        },
        {
            cid: 0x53;
            action =
            {
                type: "Keypress";
                keys: ["KEY_VOLUMEDOWN"];
            };
        },
#        {
#            cid: 0xc3;
#            action =
#            {
#                type: "ChangeHost";
#                host: 1;
#            };
#        },
    );
}
);

Restart logid.service to enable changes:

sudo systemctl restart logid

Programmable Mouse Buttons

  • 0x52 - scroll wheel button
  • 0x53 - back button
  • 0x56 - forward button
  • 0xc3 - thumb button (default "Gesture" button with Logitech Options software)
  • 0xc4 - mode shift button (by default toggles between ratchet and free-spin wheel modes)

View connected logi device buttons:

sudo logid -v

View keycodes:

sudo libinput debug-events --show-keycodes

If logid doesn't start on boot

With EndeavourOS my system seems to have an issue running logid on boot. sudo systemctl status logid returns with 'Active: active (running)', but is non-functional. It seems it relies on another service to be running first and gets loaded at the wrong time. An easy 'temporary' fix for this is to create a timer for the logid service:

/usr/lib/systemd/system/logid.timer

[Unit]
Description=Run logid on boot

[Timer]
OnBootSec=10

[Install]
WantedBy=timers.target

Disable logid.service - sudo systemctl disable logid.service Enable logid.timer - sudo systemctl disable logid.timer

Now logid.timer will be called and start logid.service 10 seconds later. Note that you might need to edit the timer to suit your own system, for example 1min is much too long of a delay and 5(s) is too quick for my system.

A better fix would be to check that the required services are running before starting logid, but that's above my paygrade.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment