Created
January 30, 2018 04:21
-
-
Save noisysocks/52f3de3b06ad9e7a3becc5cd29148f1e to your computer and use it in GitHub Desktop.
Reminder to rest your eyes every 20 minutes
This file contains 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
#!/bin/bash | |
# A little script to remind you to look away from your screen every so often. | |
# | |
# To install: | |
# 1. Save this script somewhere | |
# 2. Make the script executable: chmod +x /path/to/the/script.sh | |
# 3. crontab -e | |
# 4. Add this entry: */20 9-17 * * * /path/to/the/script.sh | |
messages[0]="Look outside at all the happy people." | |
messages[1]="What's that over there!?" | |
messages[2]="Maybe go get a drink of water?" | |
messages[3]="Do I have to tell you twice?" | |
messages[4]="I wonder what's happening out the window?" | |
messages[5]="I hear clouds are really neat." | |
messages[6]="The optometrist said you gotta." | |
idx=$(( RANDOM % ${#messages[@]} )) | |
message=${messages[$idx]} | |
osascript -e "display notification \"$message\" with title \"Look away! 👀\"" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment