Skip to content

Instantly share code, notes, and snippets.

@noisysocks
Created January 30, 2018 04:21
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save noisysocks/52f3de3b06ad9e7a3becc5cd29148f1e to your computer and use it in GitHub Desktop.
Save noisysocks/52f3de3b06ad9e7a3becc5cd29148f1e to your computer and use it in GitHub Desktop.
Reminder to rest your eyes every 20 minutes
#!/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