InstallPackages.sh 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. #!/bin/bash -xe
  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. while true; do
  15. read -p "install (X)fce4 or (L)xqt, if unsure choose (X)fce4: " XL
  16. case $XL in
  17. [Xx]* ) DE=xfce; break;;
  18. [Ll]* ) DE=lxqt; break;;
  19. * ) echo "Please answer (X)fce4 or (L)xqt";;
  20. esac
  21. done
  22. locale-gen
  23. #Install shared packages
  24. 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 xserver-xorg-input-synaptics mousepad vlc dconf-tools sudo dtrx emacs25
  25. apt install -y network-manager-gnome network-manager-openvpn network-manager-openvpn-gnome
  26. [ "$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
  27. [ "$DE" = "lxqt" ] && apt install -y lxqt
  28. if [ "$DE" = "xfce" ]
  29. then
  30. #Install packages not in an apt repo
  31. dpkg -i $DIR/xfce-themes/*
  32. #Copy in xfce4 default settings
  33. cp -f $DIR/xfce-config/xfce-perchannel-xml/* /etc/xdg/xfce4/xfconf/xfce-perchannel-xml/
  34. cp -f $DIR/xfce-config/panel/* /etc/xdg/xfce4/panel/
  35. #Copy in lightdm/light greeter settings
  36. cp -f $DIR/xfce-config/lightdm/* /etc/lightdm/
  37. #Copy in wallpapers
  38. rm /usr/share/images/desktop-base/default && cp $DIR/wallpapers/* /usr/share/images/desktop-base/
  39. #Install libinput-gestures and xfdashboard "packages"
  40. cd $DIR/packages/
  41. dtrx libinput-gestures.tar.gz
  42. cd libinput-gestures
  43. make install
  44. cd ..
  45. #Add libinput-gestures config and autostart
  46. cp $DIR/xfce-config/libinput-gestures/libinput-gestures.conf /etc/
  47. cp $DIR/xfce-config/libinput-gestures/libinput-gestures.desktop /etc/xdg/autostart/
  48. #Make plank autostart
  49. cp $DIR/xfce-config/plank/plank.desktop /etc/xdg/autostart/
  50. #install plank launcher
  51. mkdir -p /etc/skel/.config/plank/dock1/launchers/
  52. cp -rf $DIR/xfce-config/plank/plank-launchers/* /etc/skel/.config/plank/dock1/launchers/
  53. #Install xmodmap map, autostart
  54. cp -rf $DIR/xfce-config/xmodmap/.Xmodmap /etc/skel/
  55. cp -rf $DIR/xfce-config/xmodmap/.xinitrc /etc/skel/
  56. #Install inputrc
  57. cp -rf $DIR/xfce-config/inputrc/.inputrc /etc/skel/
  58. #Install brightness controls
  59. cp $DIR/xfce-config/brightness/backlight_* /usr/sbin/
  60. mkdir -p /etc/udev/rules.d/
  61. cp $DIR/xfce-config/brightness/backlight.rules /etc/udev/rules.d/
  62. fi
  63. #Copy in acpi, pulse audio, trackpad settings, funtion key settings
  64. cp -rf $DIR/default.pa /etc/pulse/default.pa
  65. cp -rf $DIR/sound.sh /etc/acpi/sound.sh
  66. cp -rf $DIR/headphone-acpi-toggle /etc/acpi/events/headphone-acpi-toggle
  67. mkdir /etc/X11/xorg.conf.d/
  68. cp -rf $DIR/50-synaptics.conf /etc/X11/xorg.conf.d/
  69. apt clean && apt autoremove --purge
  70. dmesg -D
  71. #Force a safe username
  72. while true; do
  73. echo " Enter new username: "
  74. read username
  75. #ensure no whitespace
  76. case $username in *\ *) echo usernames may not contain whitespace;; *) break;; esac
  77. done
  78. until adduser $username --gecos ""
  79. do
  80. while true; do
  81. echo " Enter new username: "
  82. read username
  83. #ensure no whitespace
  84. case $username in *\ *) echo usernames may not contain whitespace;; *) break;; esac
  85. done
  86. done
  87. usermod -a -G sudo,netdev,input,video $username
  88. dmesg -E
  89. reboot