Guest User

cthulhu-connect.sh

a guest
May 26th, 2011
483
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×