Skip to content

Instantly share code, notes, and snippets.

@pogpog
Last active February 11, 2026 12:24
Show Gist options
  • Select an option

  • Save pogpog/07bd596e7ef98ee1978583c1e42b67a8 to your computer and use it in GitHub Desktop.

Select an option

Save pogpog/07bd596e7ef98ee1978583c1e42b67a8 to your computer and use it in GitHub Desktop.
Swap mouse keys for specific mouse.
  1. Show device list in terminal:

xinput list

  1. Displays something like:
⎡ Virtual core pointer                    	    id=2	[master pointer  (3)]
⎜   ↳ Virtual core XTEST pointer              	id=5	[slave  pointer  (2)]
⎜   ...
⎜   ↳ 2.4G Mouse                              	id=11	[slave  pointer  (2)]
⎣ Virtual core keyboard                   	    id=3	[master keyboard (2)]
    ↳ Virtual core XTEST keyboard             	id=1	[slave  keyboard (3)]
    ↳ Video Bus                               	id=2	[slave  keyboard (3)]
    ...
    ↳ Power Button                            	id=3	[slave  keyboard (3)]
  1. Swap the buttons around for mouse with id=11:

xinput set-button-map 11 3 2 1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment