Skip to content

Instantly share code, notes, and snippets.

@tsnieman
Last active October 13, 2023 07:50
Show Gist options
  • Star 34 You must be signed in to star a gist
  • Fork 8 You must be signed in to fork a gist
  • Save tsnieman/a01b5414960b265b37d5148779d3c687 to your computer and use it in GitHub Desktop.
Save tsnieman/a01b5414960b265b37d5148779d3c687 to your computer and use it in GitHub Desktop.
Logiops (Linux driver) configuration example for Logitech MX Master 3. Includes gestures, smartshift, DPI. Tested on logid v0.2.2-35-g1c209ed. File location: `/etc/logid.cfg`
// Logiops (Linux driver) configuration for Logitech MX Master 3.
// Includes gestures, smartshift, DPI.
// Tested on logid v0.2.2-35-g1c209ed.
// 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_PLAYPAUSE" ];
}
},
{
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" ];
}
}
);
};
},
// Thumb button
{
cid: 0xc3;
action = {
type: "Gestures";
gestures: (
{
direction: "None";
mode: "OnRelease";
action = {
type: "Keypress";
keys: [ "KEY_LEFTCTRL", "KEY_TAB" ];
}
},
{
direction: "Right";
mode: "OnRelease";
action = {
type: "Keypress";
keys: [ "KEY_LEFTCTRL", "KEY_PAGEDOWN" ];
}
},
{
direction: "Left";
mode: "OnRelease";
action = {
type: "Keypress";
keys: [ "KEY_LEFTCTRL", "KEY_PAGEUP" ];
}
}
);
};
},
// 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,
}
}
);
};
}
);
});
@xrazis
Copy link

xrazis commented Dec 17, 2020

You have a small typo on line 71. An 'S' is missing in "KEY_PREVIOUSSONG'.

@tsnieman
Copy link
Author

@xrazis: great catch - thank you! Updated ✨

@JustMaris
Copy link

Why are you using "false" on "hires" under "hiresscroll"?

For me it caused the scrolling to be unusable, having to scroll at max speed to create any movement. And the fix for it was setting "hires" to "true"

@tsnieman
Copy link
Author

tsnieman commented Mar 24, 2021

@ClassyLion: I don't use a HiDPI monitor, so hires=true makes scrolling way too fast for me. hires is a setting that needs tweaked for each individual setup.

@hassandraga
Copy link

I confirm, work on Redhat 8, Thank you for sharing!
[Logitech MX Master 3]

@hassandraga
Copy link

switch between windows work only for File Manager, otherways nothing happen.

@bec-o2
Copy link

bec-o2 commented May 5, 2021

I'm not sure if this is the right place for this question, let me know if I should move it somewhere else - Is there a way to make "wheel mode switch" one of the gestures in your code? The normal UI doesn't allow it, and it forces you to use up the whole button on that task. Also is there a way to trigger "wheel mode switch" and "toggle smooth scrolling" together in the same action? I find the smooth scrolling useful on freespin mode but not on ratchet mode. Thanks!

@S-trace
Copy link

S-trace commented Dec 27, 2021

Nice gestures for the "Forward" and "Wheel" buttons!
I pulled those gestures to my config.

I also would like to map the scroll wheel in the "Forward" gestures group to volume changes like this:

                    {
                        direction: "ScrollDown";
                        threshold: 1;
                        mode: "OnInterval";
                        interval: 1;
                        action =
                        {
                            type: "Keypress";
                            keys: ["KEY_VOLUMEDOWN"];
                        }
                    },
                    {
                        direction: "ScrollUp";
                        threshold: 1;
                        mode: "OnInterval";
                        interval: 1;
                        action =
                        {
                            type: "Keypress";
                            keys: ["KEY_VOLUMEUP"];
                        }
                    },

This mapping works on the M720, but does not work on MX Master 3 for some reason (I hadn't debugged this yet).

I have mappings for thumb gesture button for windows operating (maybe someone will like it):

        {
            # Thumb Gesture button
            cid: 0xd0;
            action: 
            {
                type: "Gestures";
                threshold: 50
                gestures: (
                    {
                        direction: "Up";
                        mode: "OnInterval";
                        interval: 150;
                        action:  {
                            type: "Keypress";
                            keys: ["KEY_LEFTALT", "KEY_LEFTSHIFT", "KEY_TAB"];
                        };
                    },
                    {
                        direction: "Down";
                        mode: "OnInterval";
                        interval: 150;
                        action:  {
                            type: "Keypress";
                            keys: ["KEY_LEFTALT", "KEY_TAB"];
                        };
                    },
                    {
                        direction: "Left";
                        mode: "OnInterval";
                        interval: 150;
                        action:  {
                            type: "Keypress";
                            keys: ["KEY_LEFTCTRL", "KEY_LEFTSHIFT", "KEY_TAB"];
                        };
                    },
                    {
                        direction: "Right";
                        mode: "OnInterval";
                        interval: 150;
                        action:  {
                            type: "Keypress";
                            keys: ["KEY_LEFTCTRL", "KEY_TAB"];
                        };
                    },
                    {
                        direction: "ScrollDown";
                        threshold: 1;
                        mode: "OnInterval";
                        interval: 1;
                        action =
                        {
                            type: "Keypress";
                            keys: ["KEY_LEFTCTRL", "KEY_MINUS"];
                        }
                    },
                    {
                        direction: "ScrollUp";
                        threshold: 1;
                        mode: "OnInterval";
                        interval: 1;
                        action =
                        {
                            type: "Keypress";
                            keys: ["KEY_LEFTCTRL", "KEY_LEFTSHIFT", "KEY_EQUAL"];
                        }
                    },
                    {
                        direction: "None";
                        mode: "OnRelease";
                        action =
                        {
                            type: "Keypress";
                            keys: ["KEY_LEFTCTRL", "KEY_F10"];
                        }
                    }
                );
            };
        }

This gestures group has the same problem with scroll wheel actions (works on M720, but not on MX Master 3), but the rest can be used (vertical movement switches windows, horizontal movement switches tabs, single click shows all windows to switch).

You will need to merge the following branches:
https://github.com/abraha2d/logiops/tree/appswitching-support
https://github.com/abraha2d/logiops/tree/scroll-support
Those branches are from pull requests:
PixlOne/logiops#160
PixlOne/logiops#161

UPD:
I forgot to set parameter target: true for MX Master 3 in logid.cfg:

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

With target: true scroll mappings works fine on MX Master 3.

@tsnieman
Copy link
Author

I experienced slow/weird/buggy scrolling after updating to 22.04 from a pretty old version of Ubuntu/GNOME Shell, so I updated the gist.

Notes for what I did:

  • sudoedit /etc/logid.cfg
  • set hires: true
  • sudo systemctl restart logid to use the changes

Scrolling was fine after.

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