InstallPackages.sh 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  1. #!/bin/bash -e
  2. # This file is part of PrawnOS (http://www.prawnos.com)
  3. # Copyright (c) 2018 Hal Emmerich <hal@halemmerich.com>
  4. # PrawnOS is free software: you can redistribute it and/or modify
  5. # it under the terms of the GNU General Public License version 2
  6. # as published by the Free Software Foundation.
  7. # PrawnOS is distributed in the hope that it will be useful,
  8. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. # GNU General Public License for more details.
  11. # You should have received a copy of the GNU General Public License
  12. # along with PrawnOS. If not, see <https://www.gnu.org/licenses/>.
  13. DIR=/InstallResources
  14. cat $DIR/icons/ascii-icon.txt
  15. echo ""
  16. while true; do
  17. read -p "Install (X)fce4 or (L)xqt, if unsure choose (X)fce4: " XL
  18. case $XL in
  19. [Xx]* ) DE=xfce; break;;
  20. [Ll]* ) DE=lxqt; break;;
  21. * ) echo "Please answer (X)fce4 or (L)xqt";;
  22. esac
  23. done
  24. #Set the timezone
  25. dpkg-reconfigure tzdata
  26. #Install shared packages
  27. DEBIAN_FRONTEND=noninteractive apt install -y xorg acpi-support lightdm tasksel dpkg librsvg2-common xorg xserver-xorg-input-libinput alsa-utils anacron avahi-daemon eject iw libnss-mdns xdg-utils mousepad vlc dconf-cli dconf-editor sudo dtrx emacs
  28. DEBIAN_FRONTEND=noninteractive apt install -y network-manager-gnome network-manager-openvpn network-manager-openvpn-gnome
  29. # #install firefox from buster (if buster repos are present, i.e. installed suite is less than bullseye), otherwise from default suite
  30. DEBIAN_FRONTEND=noninteractive apt -t buster install -y firefox-esr || DEBIAN_FRONTEND=noninteractive apt install -y firefox-esr
  31. # #install chromium from buster (if buster repos are present, i.e. installed suite is less than bullseye), otherwise from default suite
  32. DEBIAN_FRONTEND=noninteractive apt -t buster install -y chromium || DEBIAN_FRONTEND=noninteractive apt install -y chromium
  33. [ "$DE" = "xfce" ] && apt install -y xfce4 dbus-user-session system-config-printer tango-icon-theme xfce4-power-manager xfce4-terminal xfce4-goodies numix-gtk-theme plank accountsservice papirus-icon-theme
  34. [ "$DE" = "lxqt" ] && apt install -y lxqt pavucontrol-qt
  35. #install the keymap by patching xkb, then bindings work for any desktop environment
  36. cp $DIR/xkb/compat/* /usr/share/X11/xkb/compat/
  37. cp $DIR/xkb/keycodes/* /usr/share/X11/xkb/keycodes/
  38. cp $DIR/xkb/symbols/* /usr/share/X11/xkb/symbols/
  39. patch /usr/share/X11/xkb/rules/base < $DIR/xkb/rules/base.chromebook.patch
  40. patch /usr/share/X11/xkb/rules/base.lst < $DIR/xkb/rules/base.lst.chromebook.patch
  41. patch /usr/share/X11/xkb/rules/base.xml < $DIR/xkb/rules/base.xml.chromebook.patch
  42. patch /usr/share/X11/xkb/rules/evdev < $DIR/xkb/rules/evdev.chromebook.patch
  43. patch /usr/share/X11/xkb/rules/evdev.lst < $DIR/xkb/rules/evdev.lst.chromebook.patch
  44. patch /usr/share/X11/xkb/rules/evdev.xml < $DIR/xkb/rules/evdev.xml.chromebook.patch
  45. cp $DIR/xkb/keyboard /etc/default/keyboard
  46. if [ "$DE" = "xfce" ]
  47. then
  48. # remove light-locker, as it is broken on this machine. See issue https://github.com/SolidHal/PrawnOS/issues/56#issuecomment-504681175
  49. apt remove -y light-locker
  50. apt purge -y light-locker
  51. #xsecurelock is the lightest weight, actually functional screen locker I have been able to find
  52. # light-locker is outright broken, and xfce4-screensaver crashes if system
  53. # is told to sleep at lid close, and activate lock
  54. # gnome-screensaver shows the desktop for a fraction of a second at wakeup
  55. # xscreensaver works as well, if you prefer that but is less simple
  56. DEBIAN_FRONTEND=noninteractive apt install -y -t unstable xsecurelock
  57. #Install packages not in an apt repo
  58. dpkg -i $DIR/xfce-themes/*
  59. #Copy in xfce4 default settings
  60. cp -f $DIR/xfce-config/xfce-perchannel-xml/* /etc/xdg/xfce4/xfconf/xfce-perchannel-xml/
  61. cp -f $DIR/xfce-config/panel/* /etc/xdg/xfce4/panel/
  62. #Copy in lightdm/light greeter settings
  63. cp -f $DIR/icons/icon-small.png /etc/lightdm/icon.png
  64. chmod 644 /etc/lightdm/icon.png
  65. cp -f $DIR/xfce-config/lightdm/* /etc/lightdm/
  66. #Patch xflock4 to activate xsecurelock
  67. patch /usr/bin/xflock4 < $DIR/xfce-config/xflock-xsecurelock.patch
  68. #Copy in wallpapers
  69. rm /usr/share/images/desktop-base/default && cp $DIR/wallpapers/* /usr/share/images/desktop-base/
  70. #Install libinput-gestures and xfdashboard "packages"
  71. cd $DIR/packages/
  72. dtrx libinput-gestures.tar.gz
  73. cd libinput-gestures
  74. make install
  75. cd ..
  76. #Add libinput-gestures config and autostart
  77. cp $DIR/xfce-config/libinput-gestures/libinput-gestures.conf /etc/
  78. cp $DIR/xfce-config/libinput-gestures/libinput-gestures.desktop /etc/xdg/autostart/
  79. #Make plank autostart
  80. cp $DIR/xfce-config/plank/plank.desktop /etc/xdg/autostart/
  81. #install plank launcher
  82. mkdir -p /etc/skel/.config/plank/dock1/launchers/
  83. cp -rf $DIR/xfce-config/plank/plank-launchers/* /etc/skel/.config/plank/dock1/launchers/
  84. #install firefox-esr default settings
  85. cp $DIR/firefox-esr/prawn-settings.js /usr/lib/firefox-esr/defaults/pref/
  86. cp $DIR/firefox-esr/prawn.cfg /usr/lib/firefox-esr/
  87. #Install the source code pro font for spacemacs
  88. [ -d /usr/share/fonts/opentype ] || mkdir /usr/share/fonts/opentype
  89. cp -rf $DIR/fonts/* /usr/share/fonts/opentype/
  90. fc-cache
  91. #Install inputrc
  92. cp -rf $DIR/xfce-config/inputrc/.inputrc /etc/skel/
  93. #Install brightness control scripts
  94. cp $DIR/xfce-config/brightness/backlight_* /usr/sbin/
  95. fi
  96. #Copy in acpi, pulse audio, trackpad settings, funtion key settings
  97. cp -rf $DIR/default.pa /etc/pulse/default.pa
  98. cp -rf $DIR/sound.sh /etc/acpi/sound.sh
  99. cp -rf $DIR/headphone-acpi-toggle /etc/acpi/events/headphone-acpi-toggle
  100. mkdir /etc/X11/xorg.conf.d/
  101. cp -rf $DIR/30-touchpad.conf /etc/X11/xorg.conf.d/
  102. apt clean && apt autoremove --purge
  103. #enable periodic TRIM
  104. cp /lib/systemd/system/fstrim.{service,timer} /etc/systemd/system
  105. systemctl enable fstrim.timer
  106. dmesg -D
  107. echo ""
  108. echo ""
  109. echo ""
  110. cat $DIR/icons/ascii-icon.txt
  111. echo ""
  112. echo "*************Welcome To PrawnOS*************"
  113. echo ""
  114. #Have the user set a root password
  115. echo "-----Enter a password for the root user-----"
  116. until passwd
  117. do
  118. echo "-----Enter a password for the root user-----"
  119. passwd
  120. done
  121. #Force a safe username
  122. while true; do
  123. echo "-----Enter new username:-----"
  124. read username
  125. #ensure no whitespace
  126. case $username in *\ *) echo usernames may not contain whitespace;; *) break;; esac
  127. done
  128. until adduser $username --gecos ""
  129. do
  130. while true; do
  131. echo "-----Enter new username:-----"
  132. read username
  133. #ensure no whitespace
  134. case $username in *\ *) echo usernames may not contain whitespace;; *) break;; esac
  135. done
  136. done
  137. usermod -a -G sudo,netdev,input,video $username
  138. dmesg -E
  139. reboot