xinput

xinput is a utility to configure and test X input devices, such as mouses, keyboards, and touchpads. It is found in the xorg-xinput package.

Usage

List devices

To list what xinput devices are available, use:

$ xinput list
⎡ Virtual core pointer                    	id=2	[master pointer  (3)]
⎜   ↳ Virtual core XTEST pointer              	id=4	[slave  pointer  (2)]
⎜   ↳ DELL0ABC:DE F123:4567 Mouse             	id=9	[slave  pointer  (2)]
⎜   ↳ DELL0ABC:DE F123:4567 Touchpad          	id=10	[slave  pointer  (2)]
⎜   ↳ PS/2 Generic Mouse                      	id=16	[slave  pointer  (2)]
⎣ Virtual core keyboard                   	id=3	[master keyboard (2)]
    ↳ Virtual core XTEST keyboard             	id=5	[slave  keyboard (3)]
    ↳ Video Bus                               	id=6	[slave  keyboard (3)]
    ↳ Power Button                            	id=7	[slave  keyboard (3)]
    ...

A device may be identified by its name ("DELL0ABC:DE F123:4567 Touchpad") or ID ().

When being executed in a startup script, it is recommended that you use the name, as the ID may change following a reboot and lead to inconsistencies.

List properties

To list all the properties of a device that can be set, use the following command:

$ xinput list-props device

This may yield results like such:

Each can be identified using its name () or number ().

As with devices, it is recommended to use the name in startup scripts, as the ID may change, albeit less often.

Set device properties

Properties of devices can be set one or more (up to three) values. The syntax for setting a property to a value is:

$ xinput set-prop device property values

Where values is replaced with the value(s) of the property.

For an instance, to enable tapping with the above output. Either of the following commands could be used:

$ xinput set-prop "DELL0ABC:DE F123:4567 Touchpad" "libinput Tapping Enabled" 1

or

$ xinput set-prop 10 338 1

On success, no output should be produced.

Usage examples

Below are some of the ways xinput can be used.

Remove the middle and right mouse buttons

$ xinput set-button-map mouse-device 1 1 1

The above command will make middle and right mouse button to function like the left button. Putting zeros will disable them.

$ xinput set-button-map mouse-device 1 0 0
gollark: Bee you?
gollark: <@293066066605768714> Obviously I filter @⁡everyone pings.
gollark: Muahahaha. I am overgeneralizing the random stuff API.
gollark: Beemetic meeite deployed.
gollark: ++tel init_webhook
This article is issued from Archlinux. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.