So I just read Zed Shaw’s new post about health concerns for programmers and it sparked a new notion that I was able to quickly follow through on. In his post he describes the bad habits and neglectful behavior common to programmers that can lead to health problems, mild and severe.
None of it is particularly revelatory, but he does a great job of lining up a comprehensive listing of these problems and some suggested solutions. However you feel about Zed, it’s worth a read.
For myself, the biggest problem I have with correcting these mistakes (and surely I’m not alone) is awareness. Sure, bursts of pain in your lower back are an effective reminder that you need to address your posture, but how do you avoid getting to that point?
Scheduled, repeating tasks in Remember the Milk (my “to do” manager of choice) seemed inappropriate because they are too distracting. A “to do” creates a task for me and pulls my attention more completely away from what I’m working on. What I decided I needed were passive reminders to pull my shoulders away from my earlobes or gulp down some dihydrogen monoxide.
I did a quick search on the Ubuntu repositories for anything of the kind (you never know how far ahead people have gone with an idea before you arrive at it) but didn’t find anything, so I just did the following.
- Create a “reminders” directory (for me: /home/trevor/Bin/reminders)
- Add a shell script for each reminder type (posture.sh, water.sh)
- Add a cron task for each reminder
- Don’t ignore the notifications
Yes I know “Bin” is odd, but by default all of the home subdirectories in Ubuntu are capitalized, so I followed that convention.
The reminder scripts are intentionally primitive. I don’t need another project to manage and wanted to solve this fast. Here’s an example:
#!/bin/sh notify-send "REMINDER: POSTURE" "Take a deep breath. Slowly release it while stretching your spine and relaxing your shoulders."
And its corresponding cron entry:
10,20,40,50 * * * * env DISPLAY=:0.0 /home/trevor/Bin/reminders/posture.sh
“env DISPLAY=:0.0” is how the cron job knows where to send the graphical results of your command. If you only have one display you can leave off the “.0” but I often have an external monitor attached and that directs the output to the primary display.
I do not fire the posture reminder at 0 or 30 minutes because that’s when I have another reminder telling me I should stand up and stretch for a moment. My expectation is that a pile of reminders all on top of each other would result in all of them being ignored.
Unfortunately these reminders are somewhat easy to miss due to their rapid expiration and complete lack of required acknowledgement. While notify-send does indeed support timeouts or setting an urgency level above or below the norm, the daemon Ubuntu uses to handle notifications does not, as this astonishing and disgusting bug report informs.
Strangely, despite notify-osd documentation to the contrary, the notifications expired at 10 seconds regardless of urgency. No more, no less.
Despite that, it seems to be meeting my goals: keeping my hydrated, and reminding me to avoid squirrel pose and shoulder earrings!
