Xinput Prope Setting by Name?

Questions about hardware, drivers and peripherals
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
Kendoori
Level 5
Level 5
Posts: 748
Joined: Thu Jul 09, 2009 12:51 pm
Location: Sanibel, FL USA

Xinput Prope Setting by Name?

Post by Kendoori »

I want to control my mouse acceleration via xinput. This command does what I want; however, if I remove the device and plug it back in, it comes back with a different ID.

Code: Select all

xinput --set-prop 27 "libinput Accel Speed" -0.6
For example, when I unplug the Chicony Wireless Device (id=27) and reinsert it, the device ID=14.

Code: Select all

kenny@kenny-ThinkPad-T480:~$ xinput --list
⎡ Virtual core pointer                    	id=2	[master pointer  (3)]
⎜   ↳ Virtual core XTEST pointer              	id=4	[slave  pointer  (2)]
⎜   ↳ USB Keyboard Consumer Control           	id=21	[slave  pointer  (2)]
⎜   ↳ TPPS/2 IBM TrackPoint                   	id=26	[slave  pointer  (2)]
⎜   ↳ Chicony Wireless Device Consumer Control	id=12	[slave  pointer  (2)]
⎜   ↳ Chicony Wireless Device                 	id=27	[slave  pointer  (2)]
⎜   ↳ Synaptics TM3276-022                    	id=25	[slave  pointer  (2)]
1) Is there a way to do what I want without using the "id" and instead the name?

2) and if I want to get this to stick at reboot, is it just a question of putting the xinput string in to startup? if not, how else?
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
rene
Level 20
Level 20
Posts: 12212
Joined: Sun Mar 27, 2016 6:58 pm

Re: Xinput Prope Setting by Name?

Post by rene »

The better method is using a static Xorg configuration fragment. That is, you'd create a file e.g. /etc/X11/xorg.conf.d/chicony-wireless-device.conf as

Code: Select all

Section "InputClass"
    Identifier      "Chicony Wireless Device"
    MatchDriver     "libinput"
    MatchProduct    "Chicony Wireless Device"
    Option          "AccelSpeed" "-0.6"   
EndSection
After a restart of the X server / reboot things should be automatic; if not, scrounge around /var/log/Xorg.0.log for the proper "MatchProduct" value; I'm always unsure if xinput necessarily displays the same name as to be used there or just normally.

man libinput for possible further options.
Locked

Return to “Hardware Support”