setup.sh 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. #!/bin/sh
  2. # https://gist.github.com/davejamesmiller/1965569
  3. ask() {
  4. local prompt default reply
  5. if [ "${2:-}" = "Y" ]; then
  6. prompt="Y/n"
  7. default=Y
  8. elif [ "${2:-}" = "N" ]; then
  9. prompt="y/N"
  10. default=N
  11. else
  12. prompt="y/n"
  13. default=
  14. fi
  15. while true; do
  16. # Ask the question (not using "read -p" as it uses stderr not stdout)
  17. echo -n "$1 [$prompt]: "
  18. # Read the answer (use /dev/tty in case stdin is redirected from somewhere else)
  19. read reply </dev/tty
  20. # Default?
  21. if [ -z "$reply" ]; then
  22. reply=$default
  23. fi
  24. # Check if the reply is valid
  25. case "$reply" in
  26. Y*|y*) return 0 ;;
  27. N*|n*) return 1 ;;
  28. esac
  29. done
  30. }
  31. echo
  32. echo "Setting your clock to local time can fix issues with Windows dualboot."
  33. if ask "Do you want to set your clock to local time instead of UTC?" N; then
  34. echo "==> Setting clock to local time..."
  35. sudo timedatectl set-local-rtc 1
  36. sudo hwclock --systohc --localtime
  37. else
  38. echo "==> Not setting clock..."
  39. fi
  40. echo
  41. echo "WARNING: This script doesn't automatically install packages anymore."
  42. echo "Please add a package repository and install the packages yourself!"
  43. echo "https://github.com/linux-surface/linux-surface/wiki/Installation-and-Setup#surface-kernel-installation"
  44. echo
  45. echo "You should also check the post installation notes:"
  46. echo "https://github.com/linux-surface/linux-surface/wiki/Installation-and-Setup#post-installation"
  47. echo
  48. echo "If you want to install the packages manually instead:"
  49. echo
  50. echo "Install the patched kernel:"
  51. echo "- SL3/SP7: Use the latest release."
  52. echo "- Other devices: Use the latest 4.19/5.3 release if you want multi-touch"
  53. echo " support. 5.5 only supports pen and single-touch."
  54. echo " https://github.com/linux-surface/linux-surface/releases"
  55. echo
  56. echo "Install the IPTS firmware package:"
  57. echo " https://github.com/linux-surface/surface-ipts-firmware/releases"
  58. echo
  59. echo "Patched libwacom packages are available to better support the pen."
  60. echo "If you intend to use the pen, it's recommended that you install them!"
  61. echo " https://github.com/linux-surface/libwacom-surface-deb/releases"