You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you tried setting up the thumbwheel to increase/decrease volume, switch between tabs, or zoom in and out, you may have found that using interval: 1 is way too fast, but anything higher than that will make the scrolling unpredictable.
I think what the windows app does is to limit the amount of hotkey triggers.
I wrote a custom python script that uses ydotool and will only let the key combination fire once every 125 milliseconds and it will continue to be smooth and predictable as long as you set interval to 1.
#!/usr/bin/env python3
from evdev import InputDevice, ecodes
import time
import subprocess
import os
# Setting the YDOTOOL_SOCKET environment variable
os.environ['YDOTOOL_SOCKET'] = '/tmp/.ydotool_socket'
# Configuration
THROTTLE_TIME = 0.125 #increase for slower, decrease for faster triggering
LAST_TRIGGER = {'left': 0, 'right': 0}
# Device path (check with `evtest`)
DEVICE_PATH = '/dev/input/logi-master-mx'
# Define commands
COMMANDS = {
'left': ['ydotool', 'key', '29:1', '73:1', '73:0','29:0' ], # Ctrl+Page_Up
'right': ['ydotool', 'key', '29:1', '81:1', '81:0', '29:0'] # Ctrl+Page_Down
}
# Monitoring events
try:
device = InputDevice(DEVICE_PATH)
print(f"Monitoring device: {device.name} ({DEVICE_PATH})")
except FileNotFoundError:
print(f"ERROR: Device not found: {DEVICE_PATH}")
exit(1)
for event in device.read_loop():
if event.type == ecodes.EV_REL and event.code == ecodes.REL_HWHEEL:
now = time.time()
if event.value > 0 and now - LAST_TRIGGER['left'] > THROTTLE_TIME:
print("Thumbwheel scrolled left")
subprocess.run(COMMANDS['left'])
LAST_TRIGGER['left'] = now
elif event.value < 0 and now - LAST_TRIGGER['right'] > THROTTLE_TIME:
print("Thumbwheel scrolled right")
subprocess.run(COMMANDS['right'])
LAST_TRIGGER['right'] = now
In my setup I ctrl+pageup / down to switch between (browser, nautilus, vscode) tabs.
In firefox I still have to find a way to fix zooming, because scroll + ctrl will change font sizes when I scroll very fast, but interestingly in chromium this is not an issue.
Volume control, zooming, desktop switching, etc. should also work.
This entire endevour took me about 3 days, so this solution is not simple, but it will get you a result to what windows/mac logi+ app does.
You will need:
sudo
ydotool (or xdotool if you have x11 and not wayland),
to be able to add this script to start up automatically on boot, as a service.
logid to also start up as a service (I had difficulties with logid socket, so make sure its path is /tmp/.ydotool_socket to be able to access it.
to bind for example /dev/input/[the id of your mouse] to a fixed alias like this: /dev/input/logi-master-mx (used evtest to find out)
I set up my logid.cfg thumbwheel section to look like this:
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
If you tried setting up the thumbwheel to increase/decrease volume, switch between tabs, or zoom in and out, you may have found that using interval: 1 is way too fast, but anything higher than that will make the scrolling unpredictable.
I think what the windows app does is to limit the amount of hotkey triggers.
I wrote a custom python script that uses ydotool and will only let the key combination fire once every 125 milliseconds and it will continue to be smooth and predictable as long as you set interval to 1.
In my setup I ctrl+pageup / down to switch between (browser, nautilus, vscode) tabs.
In firefox I still have to find a way to fix zooming, because scroll + ctrl will change font sizes when I scroll very fast, but interestingly in chromium this is not an issue.
Volume control, zooming, desktop switching, etc. should also work.
This entire endevour took me about 3 days, so this solution is not simple, but it will get you a result to what windows/mac logi+ app does.
You will need:
I set up my logid.cfg thumbwheel section to look like this:
As you can see the interval is set to 1 and the keys are just empty strings, the rest of the work will be done in ydotool.
Before you start any of this, you should consider if this is important enough for you, because this might take a lot of time to setup.
I have tested this and set it up on Fedora 41. If you have a question I can try to answer, but I'm really not a linux expert, so keep that in mind.
Beta Was this translation helpful? Give feedback.
All reactions