Logitech MX Master Thumb Button with Ubuntu

Solution 1:

I managed to fix it, as you guys mentioned the thumb button on this model triggers the Control + Right Alt (aka AltGr) + Tab combination in linux. So go to Settings > Keyboard > select Navigation \ Switch system controls Change its shortcut to some other key binding and replace the default. (I changed to Shift + Control + Tab) Once you replaced this binding (Control + Right-Alt (aka AltGr) + Tab) with a new one, this combination (and the thumb button) is available to be set on another shortcut option. Move to System \ Show the overview and set a new shortcut, do this clicking on the MX's thumb button. No dependencies on any configuration edit is needed, it works like a charm on Ubuntu 18.04 LTS.

Solution 2:

By default, a Ctrl+Alt+Tab event is sent after releasing the thumb button.

Since this shortcut is not really useful for me I managed to add a new action for it thanks to xautomation (sudo apt-get install xautomation) :

  • Go to Settings > Keyboard > Shortcut and add a new personal shortcut.
  • Give it the name you want and the following command : xte 'usleep 100000' 'keydown Super_L' 'key S' 'keyup Super_L'
  • Click on your new shortcut to assign a new trigger and press the thumb button (or press Ctrl+Alt+Tab)

That's it !

Solution 3:

With a Logitech Master MX 2s, I am using @Jdlm 's approach above but with a simpler command binding:

xte 'key Super_L'

This is working fine in ubuntu 18.04, and is a bit more snappy than the original answer

Solution 4:

The command xbindkeys -k helps you to determine what you need to set in its config file under ~/.xbindkeysrc.

An example entry:

# Logitech special thumb button
"/usr/bin/xdotool key Super_L+c"
    m:0x1c + c:23
    Control+Alt+Mod2 + Tab

It helps you to make use of this special thumb button.

The example turns the special button into a Win+C, which shows all open windows on my desktop.

xbindkeys

xbindkeys is a program that allows you to launch shell commands with your keyboard or your mouse under the X Window System. It links commands to keys or mouse buttons, using a configuration file. It's independent of the window manager and can capture all keyboard keys (ex: Power, Wake...).

It optionally supports a guile-based configuration file layout, which enables you to access all xbindkeys internals, so you can have key combinations, double clicks or timed double clicks take actions. Also all functions that work in guile will work for xbindkeys.

To install xbindkeys type:

 sudo apt install xbindkeys