29

Goal

I would like to get the Thumb Button on my Logitech MX Master mouse to work under Ubuntu 17.10. Specifically, I want it to serve as a "Meta" key, by which I mean pressing it will show me all the open programs at that moment (this is called exposé in Mac computers).

I'm pretty stuck at this point. I'm not an advanced user, and need some help. Thank you in advance!

What I have tried so far:

  • I have attempted to follow this guide. I installed xbindkeys, xautomation, and x11-utils. Unfortunately, because the thumb button does not emit a specific button press in xev, I am unable to move forward.
  • I have also tried using this guide, found in the Arch Linux forums. The author correctly identifies that the button is not received as a button, but rather seems to be some synthetic key press. I tried copying & pasting, but it didn't work.

Xev Results

These are the results that I receive when I use xev to map the input generated by the thumb button press.

FocusOut event, serial 38, synthetic NO, window 0x5000001,
    mode NotifyUngrab, detail NotifyPointer

LeaveNotify event, serial 38, synthetic NO, window 0x5000001,
    root 0x2a1, subw 0x0, time 18824278, (162,35), root:(1276,64),
    mode NotifyGrab, detail NotifyNonlinear, same_screen YES,
    focus NO, state 20

EnterNotify event, serial 38, synthetic NO, window 0x5000001,
    root 0x2a1, subw 0x0, time 18824342, (162,35), root:(1276,64),
    mode NotifyNormal, detail NotifyNonlinear, same_screen YES,
    focus NO, state 16

KeymapNotify event, serial 38, synthetic NO, window 0x0,
    keys:  1   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   
           0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   

FocusIn event, serial 38, synthetic NO, window 0x5000001,
    mode NotifyGrab, detail NotifyPointer

KeymapNotify event, serial 38, synthetic NO, window 0x0,
    keys:  4294967201 0   4294967168 0   32  0   0   0   1   0   0   0   0   0   0   0   
           0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   
Yasha
  • 391

11 Answers11

25

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.

5

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 !

Jdlm
  • 51
4

I am using a Logitech MX Master 3S on Ubuntu 22.04 and none of the answers worked for me. I got the thumb button to work with solaar.

  1. Install solaar

    sudo add-apt-repository ppa:solaar-unifying/stable
    sudo apt update
    sudo apt install solaar
    
  2. Set thumb button to Mouse Gestures by opening solaar, selecting the mouse and unlocking the Key/Button Diversion setting by clicking the lock beside it, then select "Mouse Gesture Button" in the left drop down and "Mouse Gestures" in the right drop down.

  3. Change solaar rules. Either with a text editor (~/.config/solaar/rules.yaml) or the Rule Editor (button at the bottom right) Screenshot of solaar rules editor. Rule is based on these rules.

     %YAML 1.3
     ---
     - Rule:
       - And:
         - Key: [Mouse Gesture Button, released]
         - MouseGesture: []
       - KeyPress:
         - Super_L
         - click
     ...
    

That's it. The thumb button now opens the overview.

You can add more gestures as well. Example:

%YAML 1.3
---
- Rule:
  - And:
    - Key: [Mouse Gesture Button, released]
    - MouseGesture: []
  - KeyPress:
    - Super_L
    - click
- Rule:
  - MouseGesture: Mouse Right
  - KeyPress:
    - XF86_AudioNext
    - click
- Rule:
  - MouseGesture: Mouse Left
  - KeyPress:
    - XF86_AudioPrev
    - click
- Rule:
  - MouseGesture: Mouse Up
  - KeyPress:
    - XF86_AudioPlay
    - click
- Rule:
  - MouseGesture: Mouse Down
  - KeyPress:
    - XF86_AudioStop
    - click
...
Luca
  • 41
  • I performed the configuration as you've suggested but the thumb/gesture button is still not opening the overview. Solaar 1.1.9 Ubuntu 23.10, Gnome 45.2, Wayland. Here is a screenshot of my settings, both in Solaar, and the yaml file: https://i.imgur.com/pvhEJZQ.png – derek-shnosh Mar 08 '24 at 01:43
  • 1
    I removed Solaar 1.1.9 via apt and installed the latest version (1.1.11) via pip and it is now working. – derek-shnosh Mar 08 '24 at 02:02
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

Ari
  • 143
2

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
abu_bua
  • 10,783
1

This is instruction for Logitech Master 3. I have switch from master 2s. I tried to make delete on my palm button.

For Logi Master 3, I first set

xte 'key Delete' -> Super+Tab (by simply clicking the thumb button in that dialogue)

then I repeat same operation. Just this time by clicking on thumb button I get

xte 'key Delete' -> Super+Delete

enter image description here

enter image description here

...................... 2 years later after ubuntu reinstall I had to use this enter image description here

despotbg
  • 111
1

I just installed the logiops package.

Then created the /etc/logid.cfg config file with the following content:

devices: ({
  name: "Wireless Mouse MX Master 2S";

buttons: (

// Make thumb button 10.
// use it as Super_L
{ cid: 0xc3; action = { type: "Keypress"; keys: ["KEY_LEFTMETA"]; }; },

); });

Of course depending of your mouse you will need to change the line with its name - mine is Wireless Mouse MX Master 2S. You can test if the tool discovers your mouse and how to rename it with sudo logid -v.

Afterwards I started it as a service: sudo systemctl start logid and checked if it is working.

Then I added it to the autostart: sudo systemctl enable logid

From now on if you click the thumb bottow you will see the open applications in GNOME (like when using the Super key).

References:

General information about logiops: https://wiki.archlinux.org/index.php/Logitech_MX_Master

Super in logiops: https://github.com/PixlOne/logiops/issues/46

Rob Bar
  • 181
0

I used the same answer as @Jdlm, but whenever I went to reassign the CTRL+ALT+TAB shortcut, it kept triggering it.

I had to switch the Switch System Controls shortcut under navigation so it wouldn't be triggered. After that, I could reassign it to whichever xte shortcut I wanted.

zx485
  • 2,426
  • Check this here: https://elementaryos.stackexchange.com/questions/22553/logitech-mx-master-2s-how-to-assign-thumb-button – SnowGepard Feb 26 '20 at 09:50
0
  1. Go to Settings > Devices > Keyboard Shortcuts > System.
  2. Click Show the activities overview.
  3. In the Set Shortcut pop up, press the Logitech MX Master thumb button. It'll set the shortcut to Ctrl+Alt+Tab, which is the key combination the thumb button generates.
jumpnett
  • 5,975
  • I am running elementary OS 5.1 and like to use the thumb button to toggle the window overview. I can assign in, but somehow nothing happens when pressing the button or the keys on the keyboard. Any idea what could be the reason? – SnowGepard Feb 24 '20 at 19:58
  • @SnowGepard You're better off asking a new question. I'm not familiar with Elementary OS, so I'm not sure. And since this is an Ubuntu specific site, the general Unix & Linux would probably be a better place to ask it. – jumpnett Feb 26 '20 at 01:09
  • 1
    You might be right. However, I found the solution and will comment it here. Here is the solution which is actually Gnome related https://elementaryos.stackexchange.com/questions/22553/logitech-mx-master-2s-how-to-assign-thumb-button – SnowGepard Feb 26 '20 at 09:50
0

Since Ubuntu 21.10 (Impish Indri)

Tested with Logitech MX Master 3.

Settings → Keyboard → Customize Shortcuts → Navigation

  • Switch applications (or search for Super+Tab) → press Backspace to remove
  • Switch windows (or search for Alt+Tab) → press Backspace to remove

You can now reassign the MOUSE3 alias Thumb Button to your own shortcut.

User Rebo
  • 256
0

Seems like thumb button on MX Master sends Ctrl+Alt+Tab shortcut as you release it in Linux.

So you may install

sudo apt-get install compizconfig-settings-manager

Launch it and then go to > Window Management > Scale > Bindings > Initiate Window Scale

You should change keyboard shortcut since Thumb button is basically keyboard emulation and map it to Ctrl+Alt+Tab.

Note: it will replace your current Ctrl+Alt+Tab behaviour which is set to Switch to next window by default.