For future reference,
Code:
xinput watch-props <...>
is also quite useful, will wait for property changes and print to the terminal/stdout.
But yes, this changes the line that you showed.
As for the script.
Now, these values you are changing stand for:
RT, RB, LT, LB, F1, F2, F3
Right top, right bottom, left top, left bottom, finger 1,2,3.
(Source)
Technically speaking we can change any of these, but we'll just keep it simple.
Pattern matching and this kind of thing isn't my strong point.. but:
Code:
xinput get-props <device> | grep <property>
returns the relevant line.
so we can do something like this:
Code:
#!/bin/bash
device=10
property=123
mode="$(xinput list-props $device | grep $property | cut -d',' -f5)"
if [ $mode -eq "1" ] ;
then
xinput set-props $device $property 0, 0, 0, 0, 0, 0, 0
else
xinput set-props $device $property 2, 3, 0, 0, 1, 3, 2
fi
So this basically checks that the 5th argument (finger 1) is enabled, i.e. set to 1 and changes if not
save it as something,
Code:
chmod +x <filename>
to make it runnable.
I'm sure there's a much more elegant script that could be written... but it's functioning.
Bookmarks