122 lines
4.5 KiB
Bash
122 lines
4.5 KiB
Bash
#!/bin/bash
|
|
|
|
# Résolution écran
|
|
xrandr -s 1920x1080_60.00
|
|
|
|
# Bannière
|
|
cat wibian.figlet
|
|
echo -ne "\n"
|
|
|
|
# Décompte avant démarrage de l'installation
|
|
i=10
|
|
while [ $i -ge 0 ]; do printf "Démarrage de l'installation dans $i \r"; sleep 1; ((i--)); done
|
|
echo -ne "\n"
|
|
|
|
# Vérifie si le script est lancé avec les droits root
|
|
if [[ $EUID -ne 0 ]]; then
|
|
echo "Vous devez avoir les privilèges root pour exécuter le script, utiliser la commande : sudo bash install.sh" 2>&1
|
|
exit 1
|
|
fi
|
|
|
|
username=$(id -u -n 1000)
|
|
builddir=$(pwd)
|
|
|
|
# Définition du nom d'hôte
|
|
echo "- Quel nom d'hôte voulez-vous donner à cette nouvelle machine ?"
|
|
read machinename
|
|
clear
|
|
hostnamectl set-hostname $machinename
|
|
sed -i '1i 127.0.0.1\t'$machinename /etc/hosts
|
|
|
|
# noatime
|
|
cp /etc/fstab /etc/fstab.bck
|
|
awk '!/^#/ && ($3 != "swap") && ($2 != "/media/cdrom0") { if(!match(/noatime/, $4)) $4=$4",noatime" } 1' /etc/fstab > /etc/fstab.tmp
|
|
mv /etc/fstab.tmp /etc/fstab
|
|
|
|
# swapiness
|
|
echo "vm.swappiness=1" >> /etc/sysctl.conf
|
|
echo "Désactivation et vidage de la mémoire swap - Veuillez patentier..."
|
|
swapoff -a
|
|
echo "Activation de la mémoire swap avec prise en compte de la valeur 1 "
|
|
swapon -a
|
|
sleep 3
|
|
|
|
# Désinstallation complète de LibreOffice
|
|
apt remove --purge libreoffice* -y
|
|
apt autoremove -y
|
|
|
|
# Modification pour la branche unstable alias "Sid"
|
|
cp /etc/apt/sources.list /etc/apt/sources.list.bck
|
|
cp sources.list /etc/apt/sources.list
|
|
|
|
# Update packages list and update system
|
|
apt update
|
|
apt upgrade -y
|
|
|
|
# Install nala
|
|
apt install nala -y
|
|
nala fetch --auto -y
|
|
|
|
# Installation et configuration du logiciel des gestion automatique des mises à jour
|
|
# Commande pour tester le bon fonctionnement : unattended-upgrades --dry-run --debug
|
|
nala install unattended-upgrades -y
|
|
cp 50unattended-upgrades /etc/apt/apt.conf.d/50unattended-upgrades
|
|
cp /usr/share/unattended-upgrades/20auto-upgrades /etc/apt/apt.conf.d/
|
|
sed -i 's/InhibitDelayMaxSec=30/InhibitDelayMaxSec=1800/g' /usr/lib/systemd/logind.conf.d/unattended-upgrades-logind-maxdelay.conf
|
|
|
|
# Installation des paquets
|
|
nala install caja-share caja-nextcloud celluloid clementine gparted guake hugin kazam ksnip lightdm-settings mate-desktop-environment-extras metadata-cleaner numlockx peek redshift-gtk tlp smtube variety -y
|
|
|
|
# Installation des paquets utilitaires
|
|
nala install curl flatpak figlet htop libnotify-bin neofetch nmap nwipe speedtest-cli stress s-tui swaks testdisk vim -y
|
|
|
|
# Installation des thèmes wibian-light et wibian-dark
|
|
nala install greybird-gtk-theme papirus-icon-theme -y
|
|
mkdir -p /home/$username/.themes
|
|
unzip themes.zip -d /home/$username/.themes/
|
|
chown -R $username:$username /home/$username/.themes/
|
|
|
|
# Logiciels Mint
|
|
wget -q -O - "https://github.com/linuxmint/webapp-manager/releases/download/master.lmde5/packages.tar.gz" | tar -xzf - -C /tmp
|
|
nala install /tmp/packages/*deb -y
|
|
rm -r /tmp/packages/
|
|
|
|
# PVE VDI Client
|
|
nala install python3-pip python3-proxmoxer python3-tk virt-viewer git -y
|
|
git clone https://github.com/joshpatten/PVE-VDIClient.git
|
|
cd ./PVE-VDIClient/
|
|
pip3 install PySimpleGUI --break-system-packages
|
|
cp vdiclient.py /usr/local/bin
|
|
chmod +x /usr/local/bin/vdiclient.py
|
|
|
|
# Envoi du message de notification
|
|
notify-send -i $builddir/icones/sympatech_logo_bleu.png "Information" "Le script d'installation touche bientôt à sa fin" -t 0
|
|
notify-send -i $builddir/icones/sympatech_logo_rouge.png "Attention" "Redémarrage imminent après l'installation des paquets flatpak" -t 0
|
|
|
|
# Flatpak (reboot nécéssaire)
|
|
flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
|
|
flatpak install flathub com.usebottles.bottles com.github.geigi.cozy io.crow_translate.CrowTranslate com.discordapp.Discord com.jgraph.drawio.desktop com.github.tchx84.Flatseal me.hyliu.fluentreader com.github.johnfactotum.Foliate io.github.hmlendea.geforcenow-electron org.onlyoffice.desktopeditors org.jdownloader.JDownloader io.gitlab.librewolf-community org.gnome.World.PikaBackup com.github.marinm.songrec -y
|
|
|
|
# Configuration du profil dconf de l'utilisateur pour synchroniser les paramètres via un fichier texte
|
|
mkdir -p /etc/dconf/profile
|
|
cp $builddir/dconf/user /etc/dconf/profile/user
|
|
rm /home/$username/.config/dconf/user
|
|
#cp user.txt /home/$username/.config/dconf/user.txt
|
|
|
|
# Désinstallation des paquets non désirés
|
|
nala remove fortunes-min -y
|
|
|
|
# Suppression des sources d'installation du répértoire utilisateur
|
|
rm -r $builddir
|
|
|
|
# Message de fin
|
|
echo "Bisous" | figlet -f big
|
|
echo -ne "\n"
|
|
|
|
# Décompte avant redémarrage
|
|
i=10
|
|
while [ $i -ge 0 ]; do printf "Redémarrage dans $i \r"; sleep 1; ((i--)); done
|
|
|
|
# redémarrage du système
|
|
reboot now
|