A simple timer

June 16, 2010

This post is really meant for me, to remind me later how to do this, but perhaps you’ll find something useful in it too.

This is a little script using zenity that functions as a timer . When I run the script I am asked to enter a task description and then in how many minutes I want to be reminded of that (“10” is ten seconds, “10m” is ten minutes). When the time is up, a simple dialog appears that reminds me to do the task I set myself.

#!/bin/bash
#
REMINDER=`zenity --entry --title="Timer" \
 --text="What should I do?"`
WAIT=`zenity --entry --title="Timer" \
 --text="When should I do this?"`
sleep $WAIT
zenity --info --title="Timer" --text="$REMINDER"

Now I no longer need to launch a panel to run a timer panel applet (which I am sorry to admit I did for a while). This is simple and works great.