In windows I used X-Mouse Button Control to accomplish this, but I can't find a method of doing It in linux.

My main mouse is a logitech m510 which has two thumb buttons on the side, which are buttons 8 and 9.

the closest i've gotten is by using xbindkeys and xte.


"xte 'key Up'"
    b:9 + Release

"xte 'key Down'"
    b:8 + Release

But I want continuous scrolling when I press the button, not just one key movement when I press and release the button... Help?

  • 1
    I'm also looking for the same thing... This is the closest i've come up with, but i have yet to get it to actually repeat! I suspect there's something wrong with the shell script. My .xbindkeysrc: " while { xinput --query-state 9 | grep -q "12\]=down"; }; do xte 'mousedown 4' 'sleep 1' 'mouseup 4' ; done " b:12 Jan 17, 2018 at 22:40

2 Answers 2


Looking for the same thing (see comment). This does work, though: .xbindkeysrc:

" ~/src/but_10.sh "

and but_10.sh:

xte 'key Up'
sleep 0.3
while [ $(xinput --query-state 9 | grep -e "button\[10\]=down") ]
xte 'key Up'
sleep 0.05

No idea why this works, while xte 'mouseclick 4' doesn't. I'd REALLY like to get it to work that way.

  • @lestyn ap Mwg are you still looking for a way to achieve mouseclick 4/5?
    – mohkamfer
    Jan 3, 2022 at 22:18

@mohkamfer Yes, if you have found a way to make that work. I'm still using the workaround i listed, using 'key Up' and 'key Down'. I would prefer to emulate the scroll wheel.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .