Last active
March 19, 2024 10:32
-
-
Save nico-i/bf52f9e889dd7cae49d1eaddfa3521ca to your computer and use it in GitHub Desktop.
Display an intrusive prompt to drink water every 15min using a cron job
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# - OSX / MacOS - | |
# Cron Job | |
*/15 * * * * osascript -e 'tell application (path to frontmost application as text) to display dialog "Drink some water. :]" buttons {"OK"}' | |
# Automatically add cron job to existing cron jobs | |
(crontab -l ; echo "*/15 * * * * osascript -e 'tell application (path to frontmost application as text) to display dialog \"Drink some water. :]\" buttons {\"OK\"}'") | crontab - | |
# as su | |
(sudo crontab -l ; echo "*/15 * * * * osascript -e 'tell application (path to frontmost application as text) to display dialog \"Drink some water. :]\" buttons {\"OK\"}'") | sudo crontab - | |
# - Fedora Linux - | |
# Cron Job | |
*/15 * * * * zenity --info --text "Have a sip of water (:" | |
# Automatically add cron job to existing cron jobs | |
(crontab -l ; echo "*/15 * * * * zenity --info --text \"Have a sip of water (:\"") | crontab - | |
# as su | |
(sudo crontab -l ; echo "*/15 * * * * zenity --info --text \"Have a sip of water (:\"") | sudo crontab - |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment