daily pastebin goal
8%
SHARE
TWEET

cthulhu-connect.sh

a guest May 26th, 2011 233 Never
Upgrade to PRO!
ENDING IN00days00hours00mins00secs
 
  1. #!/bin/bash
  2.  
  3. # Polls Toodles PC/PS3 Cthulhu controller, preventing it from entering XBox 360
  4. # mode. Run this script as root, then plug in the controller.
  5.  
  6. DEV_DIR=/dev/input/by-id
  7. DEV_NAME=usb-Toodles_2008_Cthulhu+_PC_PS3_Controller-joystick
  8.  
  9. echo "Please connect PC/PS3 Cthulhu now."
  10.  
  11. # Loop indefinitely until Cthulhu controller is detected
  12. until [ -a $DEV_DIR/$DEV_NAME ]; do
  13.     DO_NOTHING=""
  14. done
  15.  
  16. echo "  - PC/PS3 Cthulhu detected. Ensuring connection..."
  17.  
  18. # Have Cthulhu scream into the void for a couple of seconds to ensure connection
  19. cat $DEV_DIR/$DEV_NAME > /dev/null & CAT=$!
  20. sleep 2
  21. kill $CAT
  22.  
  23. echo "  - PC/PS3 Cthulhu connected!"
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top