Skip to content

Instantly share code, notes, and snippets.

@Yrds
Last active Jan 20, 2017
Embed
What would you like to do?
#!/bin/sh
#SCRIPT TO DETECT MULTIPLE CONTROLLERS(BASED ON GREP AT LINE #6) AND PASS TO XBOXDRV
############ DO NOT USE THIS WITH A ORIGINAL XBOX GAMEPAD PLUGGED IN, YOU CAN PLUG AFTER RUNNING THE SCRIPT ############
set -e
config=/home/yuri/config.xboxdrv
joysticks=$(ls /dev/input/by-path/ | grep event-joystick)
for i in $joysticks; do
xboxdrv -c $config --evdev /dev/input/by-path/$i & XBOXPID+=$!
done
echo "Pressione CTRL+C para encerrar"
while true;do
sleep 300
done
for i in $XBOXPID; do
kill $i
wait $i
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment