Skip to content

Instantly share code, notes, and snippets.

@Yrds
Last active January 20, 2017 16:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Yrds/f4100965dbf2698f1d3137cd54592139 to your computer and use it in GitHub Desktop.
Save Yrds/f4100965dbf2698f1d3137cd54592139 to your computer and use it in GitHub Desktop.
#!/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