Got Logitech MX4 with Haptic working in CachyOS

After some trial and error, I’ve got my MX4 Master mouse to send haptic pulses, per event, per application.

The file watch.py (for real time monitoring) works with the MX4 mouse connected via Bolt or Bluetooth. But you have to have Solaar installed though, which establishes the communication with the mouse. I combine watch.py with an ~/.config/autostart shortcut.

There is also demo.py file to test all the sixteen haptic pulses (three seconds). Level is controllable from Solaar, or from demo.py itself (0 to 100)

https://github.com/Physics-of-Data/mx4-haptic-linux

The MX Master 4 ships with 16 named waveforms. Pick by feel:

Strong / distinct Soft / subtle
SHARP STATE CHANGE SQUARE
DAMP STATE CHANGE WAVE
SHARP COLLISION FIREWORK
DAMP COLLISION MAD
SUBTLE COLLISION KNOCK
HAPPY ALERT JINGLE
ANGRY ALERT RINGING
COMPLETED WHISPER COLLISIO

In watch.py you set up the applications to trigger haptic pulses, or those you want muted:

# Map application names (lowercase) to specific haptic patterns
APP_PATTERNS = {
    "claude code": "COMPLETED",
    "firefox": "KNOCK",
    "obsidian": "WAVE",
    "dolphin": "SUBTLE COLLISION",
    "rsnapshot": "JINGLE",
    "cloud-drive-ui": "KNOCK",
}

# Apps whose notifications should never trigger a haptic (lowercase).
MUTED_APPS = {
    "spectacle",
}

Enjoy!