1

I have some xinput settings that I have run on startup, but every now and then I get a system update that changes the names or ids of the xinput devices that break my startup script.

For example, I have this as a startup command:

+xinput set-prop "SynPS/2 Synaptics TouchPad" "libinput Natural Scrolling Enabled" 1

But recently the device name changed and I had to update it.

Is there a better way to specify which device I want to modify without it being volatile to changes over time?

TimE
  • 111

1 Answers1

0

How about grepping for the device and pulling out the ID with sed?

xinput set-prop `xinput list | grep -i touchpad | sed -n 's/.*id=\([0-9]*\)\s.*/\1/p'` "libinput Natural Scrolling Enabled" 1

There may be a simpler way to do this but I'm not an expert on sed.