Script GNOME : Passer de Adwaita Light à Dark automatiquement
Table des matières
Dans /home/$USER/.config/autostart
Introduction
Le script
Code BASH :
#! /bin/bash while : do heure=$(date +%H) theme=$(gsettings get org.gnome.desktop.interface gtk-theme | sed -e "s/'//g") echo "H $heure - T $theme" case $heure in 17|18|19|20|21|22|23|00|01|02|03|04|05|06|07) if [ $theme != "Adwaita-dark" ] then echo "Definition du theme Adwaita-dark" notify-send -u low -t 2000 "Changement du thème" "Thème changé vers Adwaita-dark" gsettings set org.gnome.desktop.interface gtk-theme "Adwaita-dark" gsettings set org.gnome.desktop.interface icon-theme "Papirus-Dark" #sed -e 's/style=Adwaita/style=Adwaita-Dark/' -i ~/.config/qt5ct/qt5ct.conf fi ;; *) if [ $theme != "Adwaita" ] then echo "Definition du theme Adwaita" notify-send -u low -t 2000 "Changement du thème" "Thème changé vers Adwaita Light" gsettings set org.gnome.desktop.interface gtk-theme "Adwaita" gsettings set org.gnome.desktop.interface icon-theme "Papirus" #sed -e 's/style=Adwaita-Dark/style=Adwaita/' -i ~/.config/qt5ct/qt5ct.conf fi ;; esac sleep 10 done
Lancer le script au démarrage de la session
Dans /home/$USER/.config/autostart
Code BASH :
[Desktop Entry] Type=Application Exec=/home/adrien/.adrien/themeswitcher.sh Name[fr_FR]=TThemeswitcher Name=Themeswitcher Comment[fr_FR]= Comment=