brltty-setup 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. #! /bin/sh
  2. set -e
  3. # Exits zero if a device was configured, otherwise non-zero.
  4. cat <<EOF
  5. === BRAILLE CONFIGURATION ===
  6. Please specify the type of braille device you wish to configure.
  7. See http://access.ubuntu.com/braille for details.
  8. Note that USB devices not connected via a USB serial converter will be
  9. detected automatically, so if you have one of these you can press X.
  10. B - Bluetooth
  11. S - Serial
  12. U - USB serial
  13. X - Exit
  14. EOF
  15. printf "Device type (b/s/u/x): "
  16. read device_type
  17. echo
  18. case "$device_type" in
  19. [bB])
  20. echo "== Bluetooth device configuration =="
  21. echo
  22. printf "Bluetooth device address: "
  23. read b_address
  24. echo
  25. echo "Configuring bluetooth braille device on address" \
  26. "$b_address"
  27. /lib/brltty/brltty.sh -b auto -d "bluetooth:$b_address"
  28. ;;
  29. [sS])
  30. echo "== Serial device configuration =="
  31. echo
  32. printf "Serial port (0-9 for ttyS0-9): "
  33. read s_port
  34. printf "Device type (brltty model code): "
  35. read s_model echo
  36. echo "Configuring serial braille device on ttyS$s_port"
  37. /lib/brltty/brltty.sh -b "$s_model" -d "serial:ttyS$s_port"
  38. ;;
  39. [uU])
  40. echo "== USB serial device configuration =="
  41. echo
  42. printf "USB serial port: "
  43. read u_port
  44. printf "Device type (brltty model code): "
  45. read u_model
  46. echo
  47. echo "Configuring serial braille device on ttyUSB$u_port"
  48. /lib/brltty/brltty.sh -b "$u_model" -d "serial:ttyUSB$u_port"
  49. ;;
  50. *)
  51. exit 1
  52. ;;
  53. esac
  54. exit 0