How to configure an MX Master mouse in Linux (X11 and Wayland)

Installation

sudo apt install cmake libevdev-dev libudev-dev libconfig++-dev
git clone https://github.com/PixlOne/logiops.git
mkdir logiops/build && cd logiops/build
cmake ..
make 
sudo make install
sudo systemctl enable logid
sudo systemctl enable --now logid


sudo apt-get install xbindkeys xbindkeys-config
xbindkeys --defaults > $HOME/.xbindkeysrc

Configuration

This is the content of `/etc/logid.cfg`

devices: (
{
    name: "Wireless Mouse MX Master";
    smartshift:
    {
        on: true;
        threshold: 20;
    };
    hiresscroll:
    {
        hires: true;
        invert: false;
        target: false;
    };
    dpi: 800;
thumbwheel:
{
   divert: true
   invert: false
   left: {
      mode: "NoPress";
   }
   right: {
      mode: "NoPress";
   }
}

buttons: (
    // Thumb button.
    { cid: 0xc3; action = { type: "Keypress"; keys: ["KEY_LEFTMETA"]; }; },
    // Top button.
    { cid: 0xc4; action = { type: "ToggleSmartshift"; }; },
    // Forward button.
  { cid: 0x53; action = { type: "Keypress"; keys: ["KEY_BACK"]; }; },
    // Back button.
  { cid: 0x56; action = { type: "Keypress"; keys: ["KEY_FORWARD"]; }; }

  );
});

This is the content of `~/.xbindkeysrc`

# thumb wheel up => increase volume and unmute      
"xdotool key --clearmodifiers XF86AudioRaiseVolume"
   b:7                                   
                                        
# thumb wheel down => lower volume       
"xdotool key --clearmodifiers XF86AudioLowerVolume"
   b:6     

Troubleshooting

- restart xbindkeys

killall -HUP xbindkeys
xbindkeys
xbindkeys --poll-rc

- restart logiops

sudo systemctl restart logid.service

- run logiops in Debug mode

sudo logid -v DEBUG

Wayland Support

For Wayland support just use the script in this repository.

 

Comments