#!/bin/bash function yes_or_no { while true; do read -p "$* [y/n]: " yn case $yn in [Yy]*) return 0 ;; [Nn]*) echo "Aborted" ; return 1 ;; esac done } echo "[ Pavé Numérique ] Le PC possède t’il un pavé numérique ?" echo "pavé numérique ?" install_numlockx="" yes_or_no if [ $? -eq 0 ] then install_numlockx=numlockx fi echo "[ Accessibilité ] Supprimer les options d'accessibilité ?" echo " notamment pour éviter l'activation non souhaitée de la lecture d'écran et clavier virtuel" echo "" suppr_accessibility=y yes_or_no if [ $? -eq 1 ] then suppr_accessibility=n fi echo "[ Flatpak ] Supprimer le support flatpak ?" echo " Pour un utilisateur lambda supprime les paquets flatpak & gir1.2-flatpak-1.0" echo "" suppr_flatpak=y yes_or_no if [ $? -eq 1 ] then suppr_flatpak=n fi # # TODO désactivation lock screen # org.cinnamon.desktop.screensaver lock-enabled true # org.cinnamon.settings-daemon.plugins.power lock-on-suspend false echo "[ Verrouillage veille ] Désactiver le verrouillage de l’écran ?" disablelock="" yes_or_no if [ $? -eq 0 ] then gsettings set org.cinnamon.desktop.screensaver lock-enabled false gsettings set org.cinnamon.settings-daemon.plugins.power lock-on-suspend false fi # echo " Ajout des raccourcis clavier pour le passage AZERTY <-> BÉPO - QWERTY -> BÉPO" if [ ! $( grep -q "alias azer" ~/.bashrc ) ] then if [ $XDG_SESSION_DESKTOP == cinnamon ] then echo 'alias azer="setxkbmap fr bepo_afnor"' >> ~/.bashrc else echo 'alias azer="setxkbmap fr bepo"' >> ~/.bashrc fi fi if [ ! $( grep -q "alias bépo" ~/.bashrc ) ] then echo 'alias bépo="setxkbmap fr"' >> ~/.bashrc fi if [ ! $( grep -q "alias qwer" ~/.bashrc ) ] then echo 'alias qwer="setxkbmap fr"' >> ~/.bashrc fi echo "[ Dossiers ] suppression des dossiers utilisateurs Public Warpinator Modèles" rmdir ~/Public ~/Warpinator ~/Modèles ~/Templates echo "[ Nemo ] Désactivation suppression directe" gsettings set org.nemo.preferences enable-delete false echo "[ Nemo ] Agrandissement barre des raccourcis de côté" gsettings set org.nemo.window-state sidebar-width 220 echo "[ Nemo ] Desactivation options formatage, montage, creation cre usb" gsettings set org.nemo.plugins disabled-actions "['mintstick-format.nemo_action', 'mintstick.nemo_action', 'mount-archive.nemo_action']" echo "[ Cinnamon ] changement fond d'écran" codename=$(lsb_release -cs) case $codename in vanessa ) gsettings set org.cinnamon.desktop.background picture-uri 'file:///usr/share/backgrounds/linuxmint-vanessa/eskof_bubble.jpg' ;; wilma ) gsettings set org.cinnamon.desktop.background picture-uri 'file:///usr/share/backgrounds/linuxmint-wilma/pblache_colors.jpg' ;; esac echo "[ Cinnamon ] desactivation effets" gsettings set org.cinnamon desktop-effects-workspace false echo "[ Parametres ]" gsettings set com.linuxmint.updates default-repo-is-ok true echo "[ Menu ][ Favoris ]" gsettings set org.cinnamon favorite-apps "['firefox.desktop', 'libreoffice-startcenter.desktop', 'mintinstall.desktop', 'cinnamon-settings.desktop', 'nemo.desktop']" echo "[ Menu ][ Affichage texte 'Menu']" value_menu_label="Menu " menu_cinnamon_json=~/.config/cinnamon/spices/menu@cinnamon.org/0.json if [ -f $menu_cinnamon_json ] then line=`cat $menu_cinnamon_json | grep '"menu-label":' -A 10 -n | grep value | head -n 1 | sed -e 's/-.*//'` sed -ie "${line}s/value\":.*/value\": \"${value_menu_label}\"/" $menu_cinnamon_json fi echo "[ Bureau ][ Nemo ] " nemo_desktop_metadata=~/.config/nemo/desktop-metadata if [ -f $nemo_desktop_metadata ] then timestamp=$(date +%s) sed -ie "s/nemo-icon-view-auto-layout=true/nemo-icon-view-auto-layout=false/" $nemo_desktop_metadata sed -ie "s/nemo-icon-view-layout-timestamp=.*/nemo-icon-view-layout-timestamp=${timestamp}/" $nemo_desktop_metadata fi echo "[ Bureau ] Ajout raccourcis firefox & libreoffice" if [ -d ~/Bureau ] then cp /usr/share/applications/firefox.desktop ~/Bureau/firefox.desktop && chmod +x ~/Bureau/firefox.desktop cp /usr/share/applications/libreoffice-writer.desktop ~/Bureau/libreoffice-writer.desktop && chmod +x ~/Bureau/libreoffice-writer.desktop fi # # redshift # rm_redshift_gtk_on_cinnamon_applet="" if [ $XDG_SESSION_DESKTOP == cinnamon && $(echo $(lsb_release -rs | sed -e 's/\..*//') | bc) -lt 22 ] then list_enabled_applets=$(gsettings get org.cinnamon enabled-applets) next_applet_id=$(echo $(echo $list_enabled_applets | grep -o "\:[0-9][0-9]*']$" | grep -o [0-9][0-9]*) + 1 | bc) if [ -d ~/.config/cinnamon/spices ] then wget https://cinnamon-spices.linuxmint.com/files/applets/qredshift@quintao.zip unzip qredshift@quintao.zip -d ~/.local/share/cinnamon/applets rm qredshift@quintao.zip fi if [ -d ~/.local/share/cinnamon/applets/qredshift@quintao ] then # force localisation mkdir -p ~/.local/share/locale/fr/LC_MESSAGES/ msgfmt -o ~/.local/share/locale/fr/LC_MESSAGES/qredshift@quintao.mo ~/.local/share/cinnamon/applets/qredshift@quintao/po/fr.po if $(echo $list_enabled_applets | grep --invert-match --quiet qredshift@quintao) then list_enabled_applets_upgrade=$(echo $list_enabled_applets | sed -e "s/]$/, 'panel1:right:0:qredshift@quintao:${next_applet_id}']/") gsettings set org.cinnamon enabled-applets "$list_enabled_applets_upgrade" rm_redshift_gtk_on_cinnamon_applet="redshift-gtk " sleep 1 qredshift_quintao_json=~/.config/cinnamon/spices/qredshift@quintao/qredshift@quintao.json # # reglage uniquement icone dans la barre des taches (iconLabel) # line=$(cat $qredshift_quintao_json | grep '"iconLabel":' -A 10 -n | grep value | head -n 1 | sed -e 's/-.*//') if [ ! -z ${line} ] ; then sed -ie "${line}s/value\":.*/value\": false/" $qredshift_quintao_json fi # # activation la nuit (enabledNight) # line=$(cat $qredshift_quintao_json | grep '"enabledNight":' -A 10 -n | grep value | head -n 1 | sed -e 's/-.*//') if [ ! -z ${line} ] ; then sed -ie "${line}s/value\":.*/value\": true/" $qredshift_quintao_json fi fi fi fi # # Applications au démarrage # echo "[ Démarrage ] désactivation mintwelcome" cp /etc/xdg/autostart/mintwelcome.desktop ~/.config/autostart && echo "X-GNOME-Autostart-enabled=false" >> ~/.config/autostart/mintwelcome.desktop if [ $install_numlockx == "numlockx" ] then echo "[ Démarrage ] activation pavé numérique au démarrage" sudo echo -e "[Greeter]\nactivate-numlock=true" > slick-greeter.conf sudo mv slick-greeter.conf /etc/lightdm/slick-greeter.conf fi # # Personnalisation interface drawing (dessin) # echo "[ Drawing ] interface défaut bouton - grosses icônes - informations des outils" gsettings set com.github.maoschanz.drawing deco-type 'tc' gsettings set com.github.maoschanz.drawing big-icons true gsettings set com.github.maoschanz.drawing show-labels true # # Desactivation du PAD sur PC fixe # echo "[ PAD ] Désactivation du pad sur PC fixe" if `inxi -M | grep "Type:.*System" | grep -q Desktop` then gsettings set org.cinnamon.desktop.peripherals.touchpad send-events disabled gsettings set org.gnome.desktop.peripherals.touchpad send-events disabled fi # # dpkg clean service # wget "https://wiki.desclicks.net/doku.php?do=export_code&id=linux:cybersalle&codeblock=13" -O desclicks-dpkg-clean.sh wget "https://wiki.desclicks.net/doku.php?do=export_code&id=linux:cybersalle&codeblock=16" -O desclicks-update-automation-cleanup-dpkg.service if [ -f desclicks-dpkg-clean.sh ] && [ -f desclicks-update-automation-cleanup-dpkg.service ] then if [ "$(md5sum desclicks-dpkg-clean.sh | cut -d " " -f 1)" == "500df1c30c097404ff30a4d240d3d018" ] && [ "$(md5sum desclicks-update-automation-cleanup-dpkg.service | cut -d " " -f 1)" == "f18e38418af1254a71883796b7e52f4d" ] then echo "[ dpkg clean ] mise en place du script de nettoyage de dpkg en cas d’intérution de mise à jour" sudo cp desclicks-dpkg-clean.sh /usr/local/bin sudo chmod +x /usr/local/bin/desclicks-dpkg-clean.sh sudo cp desclicks-update-automation-cleanup-dpkg.service /etc/systemd/system sudo chmod +x /etc/systemd/system/desclicks-update-automation-cleanup-dpkg.service sudo systemctl enable desclicks-update-automation-cleanup-dpkg.service else echo "[ ERROR ] lors du téléchargement de desclicks-dpkg-clean.sh et/ou desclicks-update-automation-cleanup-dpkg.service" fi else echo "[ ERROR ] lors du téléchargement de desclicks-dpkg-clean.sh et/ou desclicks-update-automation-cleanup-dpkg.service" fi # # Désactivation xwayland cinnamon2d pour éviter le changement intempestif et # echo "[ LOGIN ] désactivation possibliité cinnamon2d + cinnamon wayland (expérimental)" sudo mv /usr/share/xsessions/cinnamon2d.desktop /usr/share/xsessions/cinnamon2d.desktop.bck sudo mv /usr/share/wayland-sessions/cinnamon-wayland.desktop /usr/share/wayland-sessions/cinnamon-wayland.desktop.bck # # modification sources # echo "[ Sources Logiciels ]" echo " changement du dépot linuxmint officiel par le dépot de l'université de Reims" echo " changement pour la localisation fr pour la base ubuntu" # modif virginia sudo sed -e 's&deb http://packages.linuxmint.com virginia main upstream import backport&deb https://mirrors.univ-reims.fr/mint virginia main upstream import backport&' -i /etc/apt/sources.list.d/official-package-repositories.list # modif wilma sudo sed -e 's&deb http://packages.linuxmint.com wilma main upstream import backport&deb https://mirrors.univ-reims.fr/mint wilma main upstream import backport&' -i /etc/apt/sources.list.d/official-package-repositories.list # modif generique pour les depots de base sudo sed -e 's&http://archive.ubuntu.com/ubuntu&http://fr.archive.ubuntu.com/ubuntu&' -i /etc/apt/sources.list.d/official-package-repositories.list # # update source list # echo "[ Update source list ]" # # Suppression de paquets peu ou pas utilisés # echo "[ Suppressions ] suppression logiciels / localisations / accessibilité non utilisée" list21="" list21="libreoffice-help-de libreoffice-help-es libreoffice-help-it libreoffice-help-pt libreoffice-help-pt-br libreoffice-help-ru libreoffice-help-zh-cn libreoffice-help-zh-tw libreoffice-l10n-de libreoffice-l10n-en-za libreoffice-l10n-es libreoffice-l10n-it libreoffice-l10n-pt libreoffice-l10n-pt-br libreoffice-l10n-ru libreoffice-l10n-zh-cn libreoffice-l10n-zh-tw hexchat hexchat-common" list="" list=" timeshift mintchat webapp-manager onboard warpinator bluez-cups boot-repair gnome-calendar" list="$list $rm_redshift_gtk_on_cinnamon_applet" if [ $suppr_accessibility == "y" ] then list="$list libsonic0 libspeechd2 python3-speechd speech-dispatcher speech-dispatcher-audio-plugins orca libespeak-ng1 speech-dispatcher-espeak-ng" fi if [ $suppr_flatpak == "y" ] then list="$list flatpak gir1.2-flatpak-1.0" fi #prefixer tous les paquets à supprimer par "-" #list_suppr=$(echo $list | sed 's/ */ -/g') list_suppr=$list sudo mintupdate-cli -r update echo sudo aptitude purge -y $list21 sudo aptitude purge -y $list21 echo sudo aptitude purge -y $list_suppr sudo aptitude purge -y $list_suppr # # force mise à jour 2x (upgrade mintupgrade + upgrade) # echo "[ Mise à jour X2 ]" sudo mintupdate-cli -r update sudo mintupdate-cli -r upgrade -y sudo mintupdate-cli -r update sudo mintupdate-cli -r upgrade -y # # # list_lang_fr="language-pack-fr language-pack-fr-base language-pack-gnome-fr language-pack-gnome-fr-base language-pack-kde-fr firefox-locale-fr thunderbird-locale-fr" list_police="ttf-mscorefonts-installer fonts-crosextra-caladea fonts-crosextra-carlito ttf-ancient-fonts fonts-dejavu fonts-dejavu-extra fonts-liberation2" list_maintenance="gparted vim terminator htop smart-notifier gsmartcontrol stressapptest ncdu" list_jeux="tanglet qt6-qpa-plugins aisleriot gnome-mines gnome-mahjongg" list_multimedia="vlc vlc-l10n mint-meta-codecs gimp gimp-help-fr" list_utilitaires="pdfarranger p7zip-full p7zip-rar rar printer-driver-escpr printer-driver-all hplip " echo "[ Paquets de langue ] " echo $list_lang_fr echo "[ Polices d'écritures ]" echo $list_police echo "[ Maintenance ]" echo $list_maintenance echo "[ Jeux ]" echo $list_jeux echo "[ Utilitaires ]" echo $list_utilitaires list_install="$install_numlockx $list_lang_fr $list_police $list_maintenance $list_jeux $list_multimedia $list_utilitaires" # # Installation autres paquets # echo "[ Installations ]" echo ttf-mscorefonts-installer msttcorefonts/accepted-mscorefonts-eula select true | sudo debconf-set-selections sudo aptitude install -y $list_install # # Gestion des mises à jour # echo "[ mintupdate ] Activation automatisation maj" sudo mintupdate-automation upgrade enable echo "[ mintupdate ] Activation nettoyage vieux noyaux" sudo mintupdate-automation autoremove enable echo "[ mintupdate ] Désactivation mise à jour automatique des Flatpaks (éviter remplissage du disque dur)" gsettings set com.linuxmint.updates auto-update-flatpaks false echo "[ mintupdate ] Augmentation du temps rafraîchissement de la cache à 5h (2h par défaut)" gsettings set com.linuxmint.updates autorefresh-hours 5 # # Configuration firefox # sudo mkdir -p /etc/firefox/policies if [ ! -f policies.json ] then wget "https://wiki.desclicks.net/doku.php?do=export_code&id=linux:custom_firefox:user&codeblock=0" -O policies.json if [ "$(md5sum policies.json | cut -d " " -f 1)" == "e2dc3de9bba91f2ce8e5a9eaa62edc64" ] then sudo cp policies.json /etc/firefox/policies else echo "[ ERROR ] lors du téléchargement de policies.json" fi else echo "[ WARNING ] fichier policies.json present dans téléchargement. Copiez-le manuellement dans /etc/firefox/policies" fi # # Configutaion grammalecte # wget https://wiki.desclicks.net/lib/exe/fetch.php?media=linux:grammalecte-fr-v2.1.2.zip -O Grammalecte-fr-v2.1.2.oxt if [ -f Grammalecte-fr-v2.1.2.oxt ] then #sudo unopkg add --shared Grammalecte-fr-v2.1.2.oxt unopkg add Grammalecte-fr-v2.1.2.oxt fi # # Lancement recherche de pilotes # echo "[ Drivers ] vérification de pilotes additionnels avec driver-manager" sudo driver-manager echo "[ Nettoyage ] Supprimer les fichiers temporaires téléchargés lors de l'installation ?" echo "" clean_files_at_end=y yes_or_no if [ $? -eq 0 ] then rm -rf Grammalecte-fr-v2.1.2.oxt rm -rf desclicks-dpkg-clean.sh rm -rf desclicks-update-automation-cleanup-dpkg.service rm -rf policies.json rm upgrade_mint.sh fi # # lancement de firefox pour télécharger les extensions # killall -9 firefox-bin firefox