Why
We know that sitting for too long is harmful for our health. My solution to this problem is to set up a friendly reminder using Mac OS X’s speech to text feature, and a bit of programming. So here we go:
Steps
1). Create a reminder file under your home directory, for example,
1 | $ vi ~/break_reminder |
1 | Stand up and walk around Your_Name. |
Obviously change Your_Name to something that you want the voice to call you. This is one that I created, feel free to change the content.
2). Create the reminder shell script
1 | vi ~/reminder.sh |
1 |
|
3). Run some dry tests by running
1 | bash ~/reminder.sh |
4). Add the reminder to crontab
1 | crontab -e |
insert the following line:
0 9-16 * * 1-5 bash ~/reminder.sh
This will run the reminder script from 9am to 4pm hourly on the clock Monday through Friday. If you are new to crontab, refer to http://en.wikipedia.org/wiki/Cron for more details.
Notes
- I tried putting the meat inside ~/reminder.sh directly into crontab, didn’t work, that’s why this extra script is needed.
- Feel free to change the env from bash to zsh in ~/reminder.sh, I have tested it to work with both bash and zsh.
- Personally I prefer Serena’s voice, you need to download it via these steps: Search for “Dictation & Speech” in the spotlight -> Tick “Text to Speech” -> Tick “Customize”, then “Serena” from System Voice dropdown, you will be prompted to download the voice file if it has not been downloaded before.
- The reminder (break_reminder) and script (reminder.sh) can be found in my github repository: https://github.com/midnightcodr/break_reminder.