315 lines
9.8 KiB
Bash
315 lines
9.8 KiB
Bash
#!/usr/bin/env bash
|
|
|
|
# Bannière
|
|
cat wibian.figlet
|
|
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)
|
|
|
|
# Changement de la langue par défaut
|
|
localectl set-locale LANG=fr_FR.UTF-8
|
|
echo "La langue française a été définie par défaut pour ce système"
|
|
|
|
# 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
|
|
|
|
# Réecriture du fichier hosts avec le profil Unified hosts = (adware + malware) de Steven Black
|
|
echo "127.0.0.1 $(hostname)" > /etc/hosts
|
|
echo "127.0.1.1 $(hostname)" >> /etc/hosts
|
|
echo "" >> /etc/hosts
|
|
wget -qO- --no-check-certificate https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts >> /etc/hosts
|
|
|
|
# Désactivation de l'installation automatique des paquets recommandés
|
|
echo 'APT::Install-Recommends "0";' | tee /etc/apt/apt.conf.d/00norecommends > /dev/null
|
|
echo 'APT::Install-Suggests "0";' | tee -a /etc/apt/apt.conf.d/00norecommends > /dev/null
|
|
|
|
# noatime pour les partitions ext4 (bloc à commenter si btrfs)
|
|
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
|
|
|
|
# Mise à jour de la liste des paquets disponibles et mise à jour des paquets installés
|
|
apt update
|
|
apt upgrade -y
|
|
|
|
# Installation des composants du serveur graphique Xorg
|
|
apt install -y xorg xbacklight xbindkeys xinput xvkbd
|
|
|
|
# Installation de l'environnement de bureau MATE en mode core
|
|
apt install -y mate-desktop-environment-core
|
|
|
|
# Installation du gestionnaire d'affichage
|
|
apt install -y desktop-base lightdm lightdm-gtk-greeter-settings
|
|
|
|
# Isntallations des outils de gestion de l'alimentation.
|
|
apt install -y acpi acpid tlp
|
|
|
|
# Installation des outils de gestion du son
|
|
apt install -y alsa-utils mate-media pulseaudio
|
|
|
|
# Installation des outils de gestion des cartes réseaux
|
|
apt install -y network-manager-gnome network-manager-openvpn-gnome
|
|
|
|
# Installation des outils liés au bluetooth
|
|
apt install -y blueman pulseaudio-module-bluetooth
|
|
|
|
# Installation des outils liés aux imprimantes
|
|
apt install -y cups system-config-printer
|
|
apt install --install-recommends -y printer-driver-all
|
|
|
|
# Installation d'un outil de notification et d'installation des mises à jour
|
|
apt install -y gnome-package-updater mate-indicator-applet package-update-indicator
|
|
|
|
# Polices d'écritures and icônes
|
|
apt install -y fonts-recommended fonts-font-awesome papirus-icon-theme ttf-mscorefonts-installer
|
|
|
|
# Installation de la suite bureautique LibreOffice
|
|
apt install -y default-jre libreoffice libreoffice-gtk3 libreoffice-grammalecte libreoffice-help-fr libreoffice-l10n-fr mythes-fr openclipart-libreoffice
|
|
|
|
# Activation des services fraichement installés
|
|
systemctl enable acpid
|
|
systemctl enable cups
|
|
systemctl enable bluetooth
|
|
systemctl enable lightdm
|
|
|
|
# Installation des paquets wibian
|
|
packages=(
|
|
alarm-clock-applet
|
|
atril
|
|
brasero
|
|
caja-admin
|
|
caja-mediainfo
|
|
caja-share
|
|
caja-eiciel
|
|
celluloid
|
|
cheese
|
|
dconf-editor
|
|
firefox-esr-l10n-fr
|
|
foliate
|
|
engrampa
|
|
eom
|
|
fwupd
|
|
fwupd-amd64-signed
|
|
gnome-disk-utility
|
|
gnome-firmware
|
|
gnome-system-tools
|
|
gparted
|
|
greybird-gtk-theme
|
|
gtkhash
|
|
gucharmap
|
|
gvfs-fuse
|
|
imagination
|
|
kazam
|
|
metadata-cleaner
|
|
mate-applets
|
|
mate-applet-brisk-menu
|
|
mate-calc
|
|
mate-dock-applet
|
|
mate-power-manager
|
|
mate-screensaver
|
|
mate-system-monitor
|
|
mate-tweak
|
|
mate-utils
|
|
mozo
|
|
peek
|
|
pluma
|
|
polybar
|
|
qshutdown
|
|
picom
|
|
redshift-gtk
|
|
seahorse
|
|
shutter
|
|
simple-scan
|
|
stacer
|
|
thunderbird-l10n-fr
|
|
tilix
|
|
timeshift
|
|
variety
|
|
synaptic
|
|
xscreensaver-gl
|
|
)
|
|
|
|
for package in "${packages[@]}"; do
|
|
echo "Installation de $package..."
|
|
apt install -y $package
|
|
done
|
|
|
|
# Installation des paquets utilitaires
|
|
packages=(
|
|
curl
|
|
flatpak
|
|
freerdp2-x11
|
|
figlet
|
|
git
|
|
htop
|
|
jq
|
|
libnotify-bin
|
|
nmap
|
|
net-tools
|
|
numlockx
|
|
spice-vdagent
|
|
stress
|
|
s-tui
|
|
swaks
|
|
testdisk
|
|
trash-cli
|
|
unzip
|
|
whois
|
|
wmctrl
|
|
xdg-user-dirs-gtk
|
|
xdotool
|
|
zram-tools
|
|
)
|
|
|
|
for package in "${packages[@]}"; do
|
|
echo "Installation de $package..."
|
|
apt install -y $package
|
|
done
|
|
|
|
# Installation des paquets de dépendances requises par application
|
|
packages=(
|
|
# Iotas
|
|
gnome-keyring-pkcs11
|
|
libpam-gnome-keyring
|
|
xdg-desktop-portal-gtk
|
|
)
|
|
|
|
for package in "${packages[@]}"; do
|
|
echo "Installation de $package..."
|
|
apt install -y $package
|
|
done
|
|
|
|
# Désinstallation des paquets non désirés
|
|
apt remove -y fortunes-min
|
|
|
|
# Logiciel hors dépôts : Applications Web
|
|
wget --recursive --no-parent --no-host-directories --no-directories --accept '*webapp-manager*deb' 'http://packages.linuxmint.com/pool/main/w/webapp-manager/' -P /tmp/wibian/
|
|
release=$(ls /tmp/wibian/webapp-manager_1.* | tail -1)
|
|
apt install -y $release
|
|
|
|
# Flatpak (reboot nécéssaire)
|
|
flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
|
|
flatpak install -y flathub \
|
|
com.github.tchx84.Flatseal \
|
|
com.github.geigi.cozy \
|
|
org.kde.CrowTranslate \
|
|
com.jgraph.drawio.desktop \
|
|
org.gnome.World.Iotas \
|
|
io.github.mrvladus.List \
|
|
com.github.PintaProject.Pinta \
|
|
de.haeckerfelix.Shortwave \
|
|
com.github.marinm.songrec \
|
|
io.github.flattool.Warehouse \
|
|
app.drey.Warp
|
|
|
|
# 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
|
|
|
|
# Mise à jour du répertoire /home de l'utilisateur principal sudo à l'origine de l'installation
|
|
mkdir -p /home/$username/.config/autostart
|
|
cp $builddir/autostart/* /home/$username/.config/autostart/
|
|
# Décommenter la ligne ci-dessous si vous avez besoin d'appliquer une commande runonce
|
|
#cp $builddir/runonce/* /home/$username/.config/autostart/
|
|
mkdir -p /home/$username/.config/dconf
|
|
cp $builddir/dconf/user.txt /home/$username/.config/dconf/
|
|
mkdir -p /home/$username/.config/mate/panel2.d/default/launchers
|
|
cp $builddir/launchers/* /home/$username/.config/mate/panel2.d/default/launchers/
|
|
mkdir -p /home/$username/.config/package-update-indicator
|
|
cp $builddir/package-update-indicator/package-update-indicator.conf /home/$username/.config/package-update-indicator/
|
|
mkdir -p /home/$username/.config/variety
|
|
cp $builddir/variety/* /home/$username/.config/variety/
|
|
mkdir -p /home/$username/.shutter/profiles
|
|
cp $builddir/shutter/'*.xml' /home/$username/.shutter/profiles/
|
|
cp $builddir/shutter/settings.xml /home/$username/.shutter/
|
|
mkdir -p /home/$username/.themes
|
|
unzip $builddir/themes.zip -d /home/$username/.themes/
|
|
|
|
# Polybar pour l'utilisateur principal sudo à l'origine de l'installation (a voir dans le temps pour l'utilisateur lambda)
|
|
mkdir -p /home/$username/.config/polybar
|
|
mkdir -p /home/$username/.config/polybar/scripts
|
|
cp $builddir/polybar/config.ini /home/$username/.config/polybar/
|
|
cp $builddir/polybar/launch.sh /home/$username/.config/polybar/
|
|
cp $builddir/polybar/system-usb-udev.sh /home/$username/.config/polybar/scripts/
|
|
cp $builddir/polybar/system-bluetooth-bluetoothctl.sh /home/$username/.config/polybar/scripts/
|
|
cp $builddir/polybar/polybar.desktop /home/$username/.config/autostart/
|
|
cp $builddir/polybar/95-usb.rules /etc/udev/rules.d/
|
|
chmod +x /home/$username/.config/polybar/launch.sh
|
|
chmod +x /home/$username/.config/polybar/scripts/system-usb-udev.sh
|
|
chmod +x /home/$username/.config/polybar/scripts/system-bluetooth-bluetoothctl.sh
|
|
|
|
# Application du droit de propriété pour l'utilisateur principal sudo
|
|
chown -R $username:$username /home/$username/.config/
|
|
chown -R $username:$username /home/$username/.shutter/
|
|
chown -R $username:$username /home/$username/.themes/
|
|
|
|
# Mise à jour du répertoire /home pour les nouveaux utilisateurs via /etc/skel (Skeleton)
|
|
mkdir -p /etc/skel/.config/autostart
|
|
cp $builddir/autostart/* /etc/skel/.config/autostart/
|
|
mkdir -p /etc/skel/.config/dconf
|
|
cp $builddir/dconf/user.txt /etc/skel/.config/dconf/
|
|
mkdir -p /etc/skel/.config/mate/panel2.d/default/launchers
|
|
cp $builddir/launchers/* /etc/skel/.config/mate/panel2.d/default/launchers/
|
|
mkdir -p /etc/skel/.config/package-update-indicator
|
|
cp $builddir/package-update-indicator/package-update-indicator.conf /etc/skel/.config/package-update-indicator/
|
|
mkdir -p /etc/skel/.config/variety
|
|
cp $builddir/variety/* /etc/skel/.config/variety/
|
|
mkdir -p /etc/skel/.shutter/profiles
|
|
cp $builddir/shutter/'*.xml' /home/$username/.shutter/profiles/
|
|
cp $builddir/shutter/settings.xml /home/$username/.shutter/
|
|
mkdir -p /etc/skel/.themes
|
|
unzip $builddir/themes.zip -d /etc/skel/.themes/
|
|
|
|
# Suppression des sources d'installation du script
|
|
rm -r $builddir
|
|
rm -r /tmp/wibian/
|
|
|
|
# Activation de la gestion des interfaces dans NetworkManager
|
|
sed -i 's/false/true/g' /etc/NetworkManager/NetworkManager.conf
|
|
sed -i '9,$d' /etc/network/interfaces
|
|
|
|
# Configuration de l'utilitaire zram-tools
|
|
sed -i 's/^#\s*ALGO=lz4/ALGO=lz4/' /etc/default/zramswap
|
|
sed -i 's/^#\s*PERCENT=50/PERCENT=25/' /etc/default/zramswap
|
|
sed -i 's/^PERCENT=50/PERCENT=25/' /etc/default/zramswap
|
|
|
|
# Ajout de l'utilisateur principal dans le groupe lpadmin pour effectuer des tâches administratives liées à CUPS
|
|
usermod -aG lpadmin $username
|
|
|
|
# Installation des drivers Nvidia (reboot nécessaire)
|
|
gpu=$(lspci | grep -i 'nvidia')
|
|
|
|
if [[ -n $gpu ]]; then
|
|
printf 'Une carte Nvidia a été détectée: %s\n' "$gpu"
|
|
apt install -y linux-headers-amd64
|
|
apt install -y firmware-misc-nonfree nvidia-driver nvidia-settings nvidia-smi
|
|
apt install -y nvidia-cuda-dev nvidia-cuda-toolkit
|
|
else
|
|
printf 'Aucune carte Nvidia détectée\n'
|
|
fi
|
|
|
|
# Nettoyage des paquets inutiles du système
|
|
apt autoremove
|
|
|
|
# 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
|