When — I just can’t leave it alone
Sterling Camden
I’ve added some new features to my add-ons for the when calendar program. You can download the tarball below, or pull it from BitBucket.
Audible reminders
I found that I wasn’t always noticing my reminders in xmobar, so I decided to add sound effects. I changed remindwhen.rb to look for a file named ~/.when/reminder.wav. If it exists, that file is played (using mplayer) whenever a reminder is output.
Since my xmobar checks reminders every minute, and I sometimes want advance warning on a reminder, I found that the beeping once a minute can get pretty aggravating. So I wanted a way to mute the alarms temporarily. Thus, I created a shell script to turn the alarm on or off (by renaming reminder.wav) and tied it to a key shortcut in xmonad. I then added a visual indicator to xmobar when alarms are muted. How that works is all described in the README.
I also found that for some reminders I don’t want an audible alarm ever. So I added a ‘quiet’ option within the text of the reminder, and I changed remindwhen.rb to strip that out (as well as any advance) before outputting the event.
Calendar format
I was so proud of my enhancements to when that I showed my wife my new scheduling tools. “Yuck,” she said, “how can I see it as a calendar?”
Hmm, that’s true. When looking for open days, you need to see the whole grid with weekdays – not just the already scheduled events.
So I wrote a couple of more scripts to pipe when’s output to pcal to create an HTML calendar that includes the event text on the right days. Then I created another script that, with one command, invokes when piping the result through the first script and into w3m for viewing on a terminal.
By-product
As part of the implementation of the alarm support, I wrote a very handy little script to do an in-line, ternary conditional echo. It’s called, oddly enough, “echoif”:
echoif “likeit” “applause” “`criticism`”
For details on how to use these new scripts, see the README.
Posted in Ruby, Unix |
1 Comment » RSS 2.0 | Sphere it!





