#!/bin/sh -e

# Install LXDE
sudo apt install lxde-core


# Install lightdm
sudo apt install lightdm

# install unzip

# Reboot !!! Important

# Set up auto log in
sudo nano /etc/lightdm/lightdm.conf

[Seat:*]
pam-service=lightdm
pam-autologin-service=lightdm-autologin
autologin-user=lacaisse
autologin-user-timeout=0
session-wrapper=/etc/X11/Xsession
greeter-session=lightdm-greeter

# Install plymouth-themes
sudo apt install plymouth-themes

## Copy files ...

sudo apt install plymouth-themes
sudo update-alternatives --install /usr/share/plymouth/themes/default.plymouth default.plymouth /usr/share/plymouth/themes/lacaisse/lacaisse.plymouth 100
sudo update-initramfs -u
# sudo update-alternatives --config default.plymouth


# Setup bootsplash
# https://linuxconfig.org/setup-bootsplash-on-debian-grub-silent-or-verbose-boot-mode
VERBOSE_MODE="GRUB_CMDLINE_LINUX_DEFAULT=\"\""
QUIET_MODE="GRUB_CMDLINE_LINUX_DEFAULT=\"quiet splash\""

# File to modify
GRUB_FILE="/etc/default/grub"

# Replace first occurrence of old_content with new_content
sed -i 's/$VERBOSE_MODE/$QUIET_MODE/g' $GRUB_FILE


# Install Chromium
snap install chromium

# Customise LXDE
## Sets up LXDE autostart
### See Stage 1
### sudo chown ods:ods /home/ods/.config/lxsession/LXDE/autostart

## Hides trash icon
### See Stage 1

add last x chat from mac address to host name