2019-05-23 20:01:18 +02:00
|
|
|
#!/bin/bash -e
|
2018-06-28 02:46:28 +02:00
|
|
|
|
2018-10-10 18:29:22 +02:00
|
|
|
|
2020-06-15 23:27:21 +02:00
|
|
|
# This file is part of PrawnOS (https://www.prawnos.com)
|
2018-10-10 18:29:22 +02:00
|
|
|
# Copyright (c) 2018 Hal Emmerich <hal@halemmerich.com>
|
|
|
|
|
|
|
|
# PrawnOS is free software: you can redistribute it and/or modify
|
|
|
|
# it under the terms of the GNU General Public License version 2
|
|
|
|
# as published by the Free Software Foundation.
|
|
|
|
|
|
|
|
# PrawnOS is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
|
|
|
|
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
|
# along with PrawnOS. If not, see <https://www.gnu.org/licenses/>.
|
|
|
|
|
2018-09-06 01:35:33 +02:00
|
|
|
DIR=/InstallResources
|
2020-06-12 00:55:01 +02:00
|
|
|
# Import the package lists
|
|
|
|
source $DIR/package_lists.sh
|
2018-09-06 01:35:33 +02:00
|
|
|
|
2019-05-23 20:01:18 +02:00
|
|
|
cat $DIR/icons/ascii-icon.txt
|
|
|
|
echo ""
|
|
|
|
|
2018-09-12 04:27:40 +02:00
|
|
|
while true; do
|
2020-05-27 01:43:15 +02:00
|
|
|
read -p "Install (X)fce4, (L)xqt or (G)nome, if unsure choose (X)fce: " XL
|
2018-09-12 05:15:04 +02:00
|
|
|
case $XL in
|
2020-05-27 01:43:15 +02:00
|
|
|
[Gg]* ) DE=gnome; break;;
|
2018-09-12 04:27:40 +02:00
|
|
|
[Xx]* ) DE=xfce; break;;
|
|
|
|
[Ll]* ) DE=lxqt; break;;
|
2020-05-27 01:43:15 +02:00
|
|
|
* ) echo "Please answer (X)fce4, (L)xqt or (G)nome";;
|
2018-09-12 04:27:40 +02:00
|
|
|
esac
|
|
|
|
done
|
|
|
|
|
2019-01-11 18:41:56 +01:00
|
|
|
#Set the timezone
|
|
|
|
dpkg-reconfigure tzdata
|
|
|
|
|
2018-09-12 16:33:21 +02:00
|
|
|
#Install shared packages
|
2020-06-12 00:55:01 +02:00
|
|
|
DEBIAN_FRONTEND=noninteractive apt install -y ${base_debs_download[@]}
|
|
|
|
DEBIAN_FRONTEND=noninteractive apt install -y ${mesa_debs_download[@]}
|
2020-06-19 05:50:20 +02:00
|
|
|
DEBIAN_FRONTEND=noninteractive apt install -y ${prawnos_base_debs_prebuilt_download[@]}
|
2018-09-12 04:27:40 +02:00
|
|
|
|
2020-06-12 00:55:01 +02:00
|
|
|
[ "$DE" = "gnome" ] && apt install -y ${gnome_debs_download[@]}
|
2020-06-19 05:50:20 +02:00
|
|
|
[ "$DE" = "xfce" ] && apt install -y ${xfce_debs_download[@]} ${prawnos_base_debs_prebuilt_install[@]}
|
2020-06-12 00:55:01 +02:00
|
|
|
[ "$DE" = "lxqt" ] && apt install -y ${lxqt_debs_download[@]}
|
2018-09-12 04:27:40 +02:00
|
|
|
|
2019-10-29 22:42:10 +01:00
|
|
|
#install the keymap by patching xkb, then bindings work for any desktop environment
|
|
|
|
cp $DIR/xkb/compat/* /usr/share/X11/xkb/compat/
|
|
|
|
cp $DIR/xkb/keycodes/* /usr/share/X11/xkb/keycodes/
|
|
|
|
cp $DIR/xkb/symbols/* /usr/share/X11/xkb/symbols/
|
|
|
|
|
|
|
|
patch /usr/share/X11/xkb/rules/base < $DIR/xkb/rules/base.chromebook.patch
|
|
|
|
patch /usr/share/X11/xkb/rules/base.lst < $DIR/xkb/rules/base.lst.chromebook.patch
|
|
|
|
patch /usr/share/X11/xkb/rules/base.xml < $DIR/xkb/rules/base.xml.chromebook.patch
|
|
|
|
patch /usr/share/X11/xkb/rules/evdev < $DIR/xkb/rules/evdev.chromebook.patch
|
|
|
|
patch /usr/share/X11/xkb/rules/evdev.lst < $DIR/xkb/rules/evdev.lst.chromebook.patch
|
|
|
|
patch /usr/share/X11/xkb/rules/evdev.xml < $DIR/xkb/rules/evdev.xml.chromebook.patch
|
|
|
|
|
|
|
|
cp $DIR/xkb/keyboard /etc/default/keyboard
|
|
|
|
|
2019-12-03 03:39:48 +01:00
|
|
|
#disable ertm for csr8510 bluetooth, issue #117
|
|
|
|
echo "module/bluetooth/parameters/disable_ertm = 1" > /etc/sysfs.conf
|
|
|
|
|
2020-05-27 01:43:15 +02:00
|
|
|
if [ "$DE" = "gnome" ]
|
|
|
|
then
|
|
|
|
#install firefox-esr default settings
|
|
|
|
cp $DIR/firefox-esr/prawn-settings.js /usr/lib/firefox-esr/defaults/pref/
|
|
|
|
cp $DIR/firefox-esr/prawn.cfg /usr/lib/firefox-esr/
|
2020-05-27 01:54:00 +02:00
|
|
|
|
|
|
|
#TODO: a config file way to do the following would be nice, so that we can install the configs now instead
|
|
|
|
# of having to run the following commands after login
|
|
|
|
#Natural scrolling is un-natural
|
|
|
|
# gsettings set org.gnome.desktop.peripherals.touchpad natural-scroll false
|
|
|
|
#Tap to click is natural
|
|
|
|
# gsettings set org.gnome.desktop.peripherals.touchpad tap-to-click true
|
2020-05-27 01:43:15 +02:00
|
|
|
fi
|
|
|
|
|
2018-09-22 06:12:52 +02:00
|
|
|
if [ "$DE" = "xfce" ]
|
|
|
|
then
|
2019-09-15 23:17:48 +02:00
|
|
|
# remove light-locker, as it is broken on this machine. See issue https://github.com/SolidHal/PrawnOS/issues/56#issuecomment-504681175
|
|
|
|
apt remove -y light-locker
|
|
|
|
apt purge -y light-locker
|
|
|
|
|
2018-09-22 06:12:52 +02:00
|
|
|
#Install packages not in an apt repo
|
|
|
|
dpkg -i $DIR/xfce-themes/*
|
|
|
|
|
|
|
|
#Copy in xfce4 default settings
|
|
|
|
cp -f $DIR/xfce-config/xfce-perchannel-xml/* /etc/xdg/xfce4/xfconf/xfce-perchannel-xml/
|
|
|
|
cp -f $DIR/xfce-config/panel/* /etc/xdg/xfce4/panel/
|
2019-05-23 00:50:16 +02:00
|
|
|
|
2018-09-22 06:12:52 +02:00
|
|
|
#Copy in lightdm/light greeter settings
|
2019-05-23 20:01:18 +02:00
|
|
|
cp -f $DIR/icons/icon-small.png /etc/lightdm/icon.png
|
2019-05-23 23:47:16 +02:00
|
|
|
chmod 644 /etc/lightdm/icon.png
|
2018-09-22 06:12:52 +02:00
|
|
|
cp -f $DIR/xfce-config/lightdm/* /etc/lightdm/
|
2019-05-23 00:50:16 +02:00
|
|
|
|
2019-06-25 20:42:22 +02:00
|
|
|
|
2019-09-15 23:17:48 +02:00
|
|
|
#Patch xflock4 to activate xsecurelock
|
|
|
|
patch /usr/bin/xflock4 < $DIR/xfce-config/xflock-xsecurelock.patch
|
2019-06-25 20:42:22 +02:00
|
|
|
|
2018-09-22 06:12:52 +02:00
|
|
|
#Copy in wallpapers
|
|
|
|
rm /usr/share/images/desktop-base/default && cp $DIR/wallpapers/* /usr/share/images/desktop-base/
|
|
|
|
|
|
|
|
#Install libinput-gestures and xfdashboard "packages"
|
|
|
|
cd $DIR/packages/
|
|
|
|
dtrx libinput-gestures.tar.gz
|
|
|
|
cd libinput-gestures
|
|
|
|
make install
|
|
|
|
cd ..
|
|
|
|
|
|
|
|
#Add libinput-gestures config and autostart
|
|
|
|
cp $DIR/xfce-config/libinput-gestures/libinput-gestures.conf /etc/
|
|
|
|
cp $DIR/xfce-config/libinput-gestures/libinput-gestures.desktop /etc/xdg/autostart/
|
|
|
|
|
|
|
|
#Make plank autostart
|
|
|
|
cp $DIR/xfce-config/plank/plank.desktop /etc/xdg/autostart/
|
|
|
|
|
2018-09-22 17:59:30 +02:00
|
|
|
#install plank launcher
|
|
|
|
mkdir -p /etc/skel/.config/plank/dock1/launchers/
|
2018-09-22 18:01:15 +02:00
|
|
|
cp -rf $DIR/xfce-config/plank/plank-launchers/* /etc/skel/.config/plank/dock1/launchers/
|
2018-10-01 17:43:28 +02:00
|
|
|
|
2018-10-30 20:02:41 +01:00
|
|
|
#install firefox-esr default settings
|
|
|
|
cp $DIR/firefox-esr/prawn-settings.js /usr/lib/firefox-esr/defaults/pref/
|
|
|
|
cp $DIR/firefox-esr/prawn.cfg /usr/lib/firefox-esr/
|
|
|
|
|
2018-10-30 21:03:57 +01:00
|
|
|
#Install the source code pro font for spacemacs
|
|
|
|
[ -d /usr/share/fonts/opentype ] || mkdir /usr/share/fonts/opentype
|
|
|
|
cp -rf $DIR/fonts/* /usr/share/fonts/opentype/
|
|
|
|
fc-cache
|
|
|
|
|
2018-10-02 21:47:47 +02:00
|
|
|
#Install inputrc
|
2018-10-03 00:28:37 +02:00
|
|
|
cp -rf $DIR/xfce-config/inputrc/.inputrc /etc/skel/
|
2018-10-02 21:47:47 +02:00
|
|
|
|
2019-10-29 22:42:10 +01:00
|
|
|
#Install brightness control scripts
|
2018-10-01 17:43:28 +02:00
|
|
|
cp $DIR/xfce-config/brightness/backlight_* /usr/sbin/
|
2018-09-22 06:12:52 +02:00
|
|
|
fi
|
2018-09-13 00:58:33 +02:00
|
|
|
|
2018-09-12 22:22:44 +02:00
|
|
|
|
2018-06-28 02:46:28 +02:00
|
|
|
#Copy in acpi, pulse audio, trackpad settings, funtion key settings
|
2018-09-06 01:35:33 +02:00
|
|
|
cp -rf $DIR/default.pa /etc/pulse/default.pa
|
2020-01-11 23:37:14 +01:00
|
|
|
# Disable flat-volumes in pulseaudio, fixes broken sound for some sources in firefox
|
|
|
|
echo "flat-volumes = no" > /etc/pulse/daemon.conf
|
2018-09-06 01:35:33 +02:00
|
|
|
cp -rf $DIR/sound.sh /etc/acpi/sound.sh
|
|
|
|
cp -rf $DIR/headphone-acpi-toggle /etc/acpi/events/headphone-acpi-toggle
|
2018-06-28 02:46:28 +02:00
|
|
|
mkdir /etc/X11/xorg.conf.d/
|
2018-10-25 21:12:09 +02:00
|
|
|
cp -rf $DIR/30-touchpad.conf /etc/X11/xorg.conf.d/
|
2018-06-28 02:46:28 +02:00
|
|
|
|
2019-12-29 22:31:58 +01:00
|
|
|
apt clean -y && apt autoremove --purge -y
|
2018-06-30 22:08:35 +02:00
|
|
|
|
2019-12-30 07:06:01 +01:00
|
|
|
#reload the CA certificate symlinks
|
|
|
|
update-ca-certificates --fresh
|
|
|
|
|
2018-11-07 18:56:06 +01:00
|
|
|
#enable periodic TRIM
|
2019-09-15 23:17:48 +02:00
|
|
|
cp /lib/systemd/system/fstrim.{service,timer} /etc/systemd/system
|
2018-11-07 18:56:06 +01:00
|
|
|
systemctl enable fstrim.timer
|
|
|
|
|
2018-10-05 02:10:11 +02:00
|
|
|
dmesg -D
|
2018-06-30 22:08:35 +02:00
|
|
|
|
2019-05-23 23:47:16 +02:00
|
|
|
echo ""
|
|
|
|
echo ""
|
|
|
|
echo ""
|
|
|
|
|
|
|
|
cat $DIR/icons/ascii-icon.txt
|
|
|
|
echo ""
|
|
|
|
echo "*************Welcome To PrawnOS*************"
|
|
|
|
echo ""
|
2019-01-09 22:05:50 +01:00
|
|
|
#Have the user set a root password
|
2019-05-23 23:47:16 +02:00
|
|
|
echo "-----Enter a password for the root user-----"
|
2019-01-10 20:43:03 +01:00
|
|
|
until passwd
|
|
|
|
do
|
2019-05-23 23:47:16 +02:00
|
|
|
echo "-----Enter a password for the root user-----"
|
2019-01-10 20:43:03 +01:00
|
|
|
passwd
|
|
|
|
done
|
2019-01-09 22:05:50 +01:00
|
|
|
|
2018-10-05 02:10:11 +02:00
|
|
|
#Force a safe username
|
|
|
|
while true; do
|
2019-05-23 23:47:16 +02:00
|
|
|
echo "-----Enter new username:-----"
|
2018-10-10 22:09:02 +02:00
|
|
|
read username
|
|
|
|
#ensure no whitespace
|
|
|
|
case $username in *\ *) echo usernames may not contain whitespace;; *) break;; esac
|
|
|
|
done
|
|
|
|
until adduser $username --gecos ""
|
|
|
|
do
|
2018-10-05 02:10:11 +02:00
|
|
|
while true; do
|
2019-05-23 23:47:16 +02:00
|
|
|
echo "-----Enter new username:-----"
|
2018-10-05 02:10:11 +02:00
|
|
|
read username
|
|
|
|
#ensure no whitespace
|
|
|
|
case $username in *\ *) echo usernames may not contain whitespace;; *) break;; esac
|
2018-10-10 22:09:02 +02:00
|
|
|
done
|
2018-10-05 02:10:11 +02:00
|
|
|
done
|
2018-10-10 22:09:02 +02:00
|
|
|
|
2019-12-03 03:39:48 +01:00
|
|
|
usermod -a -G sudo,netdev,input,video,bluetooth $username
|
2018-06-30 22:08:35 +02:00
|
|
|
|
2018-10-05 02:10:11 +02:00
|
|
|
dmesg -E
|
2018-09-14 17:38:03 +02:00
|
|
|
|