For example: xmodmap -pp /* number of pointer events -- 12 in my case */ xmodmap -e "pointer = 1 $(pointer=12 ; while [ $pointer -gt 1 ]; do echo -n "${pointer} " ; let pointer=pointer-1; done)" Which of course means: xmodmap -e pointer = 1 12 11 10 9 8 7 6 5 4 3 2