the stuff

heads-welcome 1.9KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. #!/bin/sh
  2. #
  3. # Copyright (c) 2016-2018 Ivan J. <parazyd@dyne.org>
  4. # See LICENSE file for copyright and license details.
  5. #
  6. # heads initial setup
  7. # Inspired by the Tails welcome screen.
  8. rm -f /etc/sudoers.d/heads-welcome
  9. data="$(yad \
  10. --title="Welcome to heads!" \
  11. --text="<big><b>Welcome to heads!</b></big>
  12. Here you can choose to customize your system before starting the graphical environment.
  13. Select any option below to proceed.
  14. " \
  15. --form \
  16. --columns=1 \
  17. --borders=40 \
  18. --center \
  19. --width=640 \
  20. --height=480 \
  21. --fixed \
  22. --no-escape \
  23. --separator=":" \
  24. --field="Select a keyboard layout!preferences-desktop-keyboard-symbolic":FBTN \
  25. --field="Set the computer language (locale)!preferences-desktop-locale-symbolic":FBTN \
  26. --field="Set the timezone!preferences-system-time-symbolic":FBTN \
  27. --field="Change the root password!system-users-symbolic":FBTN \
  28. --field="":LBL \
  29. --field="<b>Miscellaneous options:</b>":LBL \
  30. --field="Randomize MAC addresses of network interfaces":CHK \
  31. --field="Disable the permakey kernel module (do not shutdown when unplugging the USB medium)":CHK \
  32. --button="Shutdown":1 \
  33. --button="<b>Start heads</b>":0 \
  34. "/usr/local/lib/heads/heads-keymap" \
  35. "/usr/local/lib/heads/heads-locale" \
  36. "/usr/local/lib/heads/heads-tz" \
  37. "/usr/local/lib/heads/heads-rootpw" \
  38. "n/a" \
  39. "n/a" \
  40. "TRUE" \
  41. "FALSE")"
  42. # Shut down on unsuccessful exit.
  43. #[ $? = 0 ] || init 0
  44. # $data:
  45. # 0: layout
  46. # 1: locale
  47. # 2: timezone
  48. # 3: rootpw
  49. # 4: n/a
  50. # 5: n/a
  51. # 6: macaddr
  52. # 7: permakey
  53. i=-1
  54. echo "$data" | tr ':' '\n' | while read val; do
  55. i=$(( $i + 1 ))
  56. case "$i" in
  57. 6)
  58. [ "$val" = TRUE ] || continue
  59. cp -f /usr/local/share/heads/wicd-preconn \
  60. /etc/wicd/scripts/preconnect/macchange
  61. chmod 755 /etc/wicd/scripts/preconnect/macchange
  62. ;;
  63. 7)
  64. [ "$val" = TRUE ] || continue
  65. lsmod | grep -q permakey && rmmod permakey || true
  66. ;;
  67. *)
  68. continue
  69. ;;
  70. esac
  71. done