mirror of the now-defunct rocklinux.org
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

56 lines
1.9 KiB

  1. #!/bin/bash
  2. #
  3. # --- ROCK-COPYRIGHT-NOTE-BEGIN ---
  4. #
  5. # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
  6. # Please add additional copyright information _after_ the line containing
  7. # the ROCK-COPYRIGHT-NOTE-END tag. Otherwise it might get removed by
  8. # the ./scripts/Create-CopyPatch script. Do not edit this copyright text!
  9. #
  10. # ROCK Linux: rock-src/package/blindcoder/joystick/joystick.init
  11. # ROCK Linux is Copyright (C) 1998 - 2006 Clifford Wolf
  12. #
  13. # This program is free software; you can redistribute it and/or modify
  14. # it under the terms of the GNU General Public License as published by
  15. # the Free Software Foundation; either version 2 of the License, or
  16. # (at your option) any later version. A copy of the GNU General Public
  17. # License can be found at Documentation/COPYING.
  18. #
  19. # Many people helped and are helping developing ROCK Linux. Please
  20. # have a look at http://www.rocklinux.org/ and the Documentation/TEAM
  21. # file for details.
  22. #
  23. # --- ROCK-COPYRIGHT-NOTE-END ---
  24. #
  25. # Desc: joystick Run joystick devices
  26. # Runlevel: 99 rcX
  27. #
  28. main_begin
  29. block_begin(start, `initialising joysticks')
  30. while read command driver device setting ; do
  31. read long short name < <( D_prefix/bin/inputattach --help | grep -- ${driver} )
  32. block_split(`${name} on ${device}')
  33. D_prefix/bin/inputattach ${driver} ${device} &
  34. sleep 1
  35. for x in /dev/input/js* ; do : ; done
  36. if [ "recalibrate" == ${setting} ] ; then
  37. D_prefix/bin/jscal -c ${x}
  38. read command parameter setting dev < <( jscal -p ${x} )
  39. sed -e "s=^joystick ${driver} ${device} recalibrate=joystick ${driver} ${device} ${setting}=g" -i /etc/conf/joystick
  40. else
  41. block_split(`setting calibration for ${name}')
  42. D_prefix/bin/jscal -s ${setting} ${x}
  43. fi
  44. done < /etc/conf/joystick
  45. block_end
  46. block_begin(stop, `removing joysticks')
  47. check(`killall inputattach')
  48. block_end
  49. block_begin(restart, `restarting joysticks')
  50. rc joystick stop
  51. rc joystick start
  52. block_end
  53. main_end