How to remap mouse buttons?

I am attempting to make my Logitech mouse’s btn_side and btn_extra switch workspaces (namely CTRL+ALT+UP and CTRL+ALT+DOWN), though so far I have not experienced any success. Here’s what my /etc/udev/hwdb.d/70-mouse-remap.hwdb looks like:

# 70-mouse-remap.hwdb
# Remap buttons on Logitech M585/M590 mouse.
evdev:name:Logitech M585/M590:*
  KEYBOARD_KEY_700e2=btn_side
  KEYBOARD_KEY_700e0=btn_side
  KEYBOARD_KEY_70051=btn_side
  KEYBOARD_KEY_700e4=btn_extra
  KEYBOARD_KEY_700e6=btn_extra
  KEYBOARD_KEY_70052=btn_extra

udevadm info returns the right stuff, but the buttons just don’t work:

dad@DadsGram~ $ sudo udevadm info /dev/input/by-path/*-usb-*-mouse | grep -A3 -P3 KEYBOARD_KEY
E: MINOR=81
E: SUBSYSTEM=input
E: USEC_INITIALIZED=417649917
E: KEYBOARD_KEY_70051=btn_side
E: KEYBOARD_KEY_70052=btn_extra
E: KEYBOARD_KEY_700e0=btn_side
E: KEYBOARD_KEY_700e2=btn_side
E: KEYBOARD_KEY_700e4=btn_extra
E: KEYBOARD_KEY_700e6=btn_extra
E: ID_INPUT=1
E: ID_INPUT_MOUSE=1
E: ID_INPUT_KEY=1

Do you have the x11-tools bundle installed?

sudo swupd bundle-list | grep x11-tools

There are 3 symbolic links missing in Clear Linux, possibly causing the remapping to fail.

Edit: /usr/share/X11/xkb/rules (changed xcb in title to xkb)

Thanks for the reply. Apparently mapping a combination of keys onto one key/button cannot be achieved w/hwdb. HWDB only handles one to one mappings.

So I’m back to square one.

That’s on hwdb, unfortunately. The issue request was created nonetheless for the Clear Linux team. Three symbolic links are missing, which exist in other Linux distributions (e.g. CentOS, Fedora, and Ubuntu). The xkbcomp command may fail, resolved by making the symbolic links.

Would using xkbcomp achieve the type of mappings that I need? Does it work with Wayland?

I’m sorry. I’m not sure.