DEV Community

Discussion on: Solving the Health Problems of Software Engineers

Collapse
 
cainwatson profile image
Cain

Thanks for sharing this info! I created a little script to remind me to look away from the screen.

Create a file. I just put it in my user's home directory: ~/scripts/look-away.sh

# Show notification and play sound
osascript -e 'display notification "Look away for 20s" with title "Look away"'
afplay /System/Library/Sounds/Frog.aiff

# Wait 20s then play another sound (to let me know to get back to work)
sleep 20s
afplay /System/Library/Sounds/Glass.aiff

Setup cron to run the script (this will open up a text editor like vim)

sudo crontab -u $(whoami) -e

Enter this to have the script run every twenty minutes

*/20 * * * * bash ~/scripts/look-away.sh