Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- #Copyright © 2021 Benoît Boudaud https://miamondo.org/contact
- #This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public
- # License as published by the Free Software Foundation, either version 3 of the License, or any later version.
- #This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
- # warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
- # You should have received a copy of the GNU General Public License along with this program.
- # If not, see <http://www.gnu.org/licenses/>
- # ----------------------------------------------------------------------------------------------------------------------
- warning=$(date -d "23:55" +%s) # Correspond à l'heure d'apparition du message : 23:55 tous les jours
- time_before_warning=$[$warning - $(date +%s)] # Calcul du temps restant avant le message d'avertissement.
- if [ $time_before_warning -lt 0 ] # Si le temps restant est négatif, cela signifie que l'avertissement est passé.
- then # Alors, on rajoute un jour (86400 secondes) et on recalcule.
- time_before_warning=$[($warning+86400) - $(date +%s)]
- fi
- sleep $time_before_warning # Le script se met en pause jusqu'au message d'avertissement.
- # Puis, à l'heure convenue, il ouvre la fenêtre popup.
- /home/$USER/Documents/Informatique/Linux/Bash/Codes/rtc/rtc.py
- # ----------------------------------------------------------------------------------------------------------------------
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement