When running from a terminal I type:
jstest /dev/input/js1 | grep '^Joystick'
and get the name.
But the jstest
cmd is interactive, and needs a Ctrl+c to finish.
How can I get such result into a shell script?
xinput -list
does not list my usb joysticks.
I could use lsusb
: it returns names but not the js position.
Suppose I have 2 joysticks (but don't know in which positions they are) and want to calibrate them. My goal is:
if (name("/dev/input/js0")=="Thrustmaster") then
jscal -s <Thrustmaster params> /dev/input/js0
jscal -s <FooJs params> /dev/input/js1
elif (name("/dev/input/js0")=="FooJs") then
jscal -s <FooJs params> /dev/input/js0
jscal -s <Thrustmaster params> /dev/input/js1
fi